From 8a54e465a2d32e60e30bf3d5d572034b0a755dd9 Mon Sep 17 00:00:00 2001 From: "sweep-ai[bot]" <128439645+sweep-ai[bot]@users.noreply.github.com> Date: Wed, 18 Oct 2023 21:41:49 +0800 Subject: [PATCH] feat: Add unit test for DeleteGroupMemberHash meth (#1200) Co-authored-by: sweep-ai[bot] <128439645+sweep-ai[bot]@users.noreply.github.com> --- tests/group_test.go | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 tests/group_test.go diff --git a/tests/group_test.go b/tests/group_test.go new file mode 100644 index 000000000..54878805e --- /dev/null +++ b/tests/group_test.go @@ -0,0 +1,22 @@ +package tests + +import ( + "testing" + + "github.com/stretchr/testify/assert" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/controller" +) + +func TestDeleteGroupMemberHash(t *testing.T) { + mockGroupDB := new(controller.MockGroupDatabase) + + testGroupMemberHash := "testGroupMemberHash" + + err := mockGroupDB.DeleteGroupMemberHash(testGroupMemberHash) + assert.Nil(t, err) + + nonExistentGroupMemberHash := "nonExistentGroupMemberHash" + + err = mockGroupDB.DeleteGroupMemberHash(nonExistentGroupMemberHash) + assert.NotNil(t, err) +}