Skip to content

Commit

Permalink
add testing of Has* methods
Browse files Browse the repository at this point in the history
  • Loading branch information
testinginprod committed Feb 6, 2024
1 parent 3a0f9da commit 8e50ee3
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions x/accounts/internal/implementation/implementation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,24 @@ func TestImplementation(t *testing.T) {
_, err := impl.Query(ctx, &types.Int32Value{Value: 1})
require.ErrorIs(t, err, errInvalidMessage)
})

t.Run("Has* methods", func(t *testing.T) {
ok := impl.HasExec(&types.StringValue{})
require.True(t, ok)

ok = impl.HasExec(&types.Duration{})
require.False(t, ok)

ok = impl.HasQuery(&types.StringValue{})
require.True(t, ok)

ok = impl.HasQuery(&types.Duration{})
require.False(t, ok)

ok = impl.HasInit(&types.StringValue{})
require.True(t, ok)

ok = impl.HasInit(&types.Duration{})
require.False(t, ok)
})
}

0 comments on commit 8e50ee3

Please sign in to comment.