Skip to content

Commit

Permalink
add unit tests for IsEntityNotExistsError (#5528)
Browse files Browse the repository at this point in the history
  • Loading branch information
arzonus authored Dec 22, 2023
1 parent f9a80ec commit d6e52e1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions common/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -478,3 +478,15 @@ func TestIsValidIDLength(t *testing.T) {
logger.AssertExpectations(t)
})
}

func TestIsEntityNotExistsError(t *testing.T) {
t.Run("is entity not exists error", func(t *testing.T) {
err := &types.EntityNotExistsError{}
require.True(t, IsEntityNotExistsError(err), "expected true, because err is entity not exists error")
})

t.Run("is not entity not exists error", func(t *testing.T) {
err := fmt.Errorf("generic error")
require.False(t, IsEntityNotExistsError(err), "expected false, because err is a generic error")
})
}

0 comments on commit d6e52e1

Please sign in to comment.