feat: Add unit test for DeleteGroupMemberHash meth (#1200)

Co-authored-by: sweep-ai[bot] <128439645+sweep-ai[bot]@users.noreply.github.com>
pull/1250/head
sweep-ai[bot] 1 year ago committed by GitHub
parent 1c1f2a96ba
commit 8a54e465a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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)
}
Loading…
Cancel
Save