feat: 补齐模块接口契约与管理 API 文档
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
package group
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"testing"
|
||||
|
||||
"git.asio.asia/nixevol/NixMsg/internal/protocol"
|
||||
)
|
||||
|
||||
func TestStubCreateNotImplemented(t *testing.T) {
|
||||
s := NewStub()
|
||||
_, err := s.Create(context.Background(), "a", &protocol.GroupCreate{Name: "g"})
|
||||
if !errors.Is(err, ErrNotImplemented) {
|
||||
t.Fatalf("got %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestStubListEmpty(t *testing.T) {
|
||||
s := NewStub()
|
||||
items, cursor, err := s.List(context.Background(), "a", &protocol.GroupList{})
|
||||
if err != nil || len(items) != 0 || cursor != "" {
|
||||
t.Fatalf("items=%v cursor=%q err=%v", items, cursor, err)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user