feat: 补齐模块接口契约与管理 API 文档
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
package presence
|
||||
|
||||
import (
|
||||
"context"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestStubGetOffline(t *testing.T) {
|
||||
s := NewStub()
|
||||
items, err := s.Get(context.Background(), []string{"a", "b"})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if len(items) != 2 || items[0].Online || items[1].Online {
|
||||
t.Fatalf("%+v", items)
|
||||
}
|
||||
}
|
||||
|
||||
func TestStubIsOnlineFalse(t *testing.T) {
|
||||
if NewStub().IsOnline("x") {
|
||||
t.Fatal("expected offline")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user