Skip to content

Commit

Permalink
add:add a unit test for delivery push
Browse files Browse the repository at this point in the history
  • Loading branch information
Yiming1997 authored and wellle committed May 15, 2024
1 parent b3b5057 commit e754f08
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test_delivery_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,15 @@ func TestDeliveryReject(t *testing.T) {
assert.Equal(t, ErrorNotFound, delivery.Ack())
assert.Equal(t, Rejected, delivery.State)
}

func TestDeliveryPush(t *testing.T) {
delivery := NewTestDelivery("p")
assert.Equal(t, Unacked, delivery.State)
assert.NoError(t, delivery.Push())
assert.Equal(t, Pushed, delivery.State)

assert.Equal(t, ErrorNotFound, delivery.Push())
assert.Equal(t, ErrorNotFound, delivery.Reject())
assert.Equal(t, ErrorNotFound, delivery.Ack())
assert.Equal(t, Pushed, delivery.State)
}

0 comments on commit e754f08

Please sign in to comment.