Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
FZambia committed May 9, 2024
1 parent dbe04c0 commit e966135
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions options_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ func TestWithIdempotencyKey(t *testing.T) {
require.Equal(t, "ik", opts.IdempotencyKey)
}

func TestWithDelta(t *testing.T) {
opt := WithDelta(true)
opts := &PublishOptions{}
opt(opts)
require.True(t, opts.UseDelta)
}

func TestWithIdempotentResultTTL(t *testing.T) {
opt := WithIdempotentResultTTL(time.Minute)
opts := &PublishOptions{}
Expand All @@ -48,6 +55,7 @@ func TestSubscribeOptions(t *testing.T) {
WithSubscribeSession("session"),
WithSubscribeClient("test"),
WithSubscribeSource(4),
WithRecoveryMode(RecoveryModeCache),
}
opts := &SubscribeOptions{}
for _, opt := range subscribeOpts {
Expand All @@ -63,6 +71,7 @@ func TestSubscribeOptions(t *testing.T) {
require.Equal(t, "test", opts.clientID)
require.Equal(t, "session", opts.sessionID)
require.Equal(t, uint8(4), opts.Source)
require.Equal(t, RecoveryModeCache, opts.RecoveryMode)
}

func TestWithDisconnect(t *testing.T) {
Expand Down

0 comments on commit e966135

Please sign in to comment.