30 lines
513 B
Go
Raw Normal View History

2020-04-21 22:50:21 +08:00
package observer
2020-05-02 21:23:04 +08:00
import (
"context"
"testing"
)
func TestObserver(t *testing.T) {
//内容提供商科技BBS
techInfoProvider := TechBBS{}
lily := User{"Lily"}
jacky := User{"Jacky"}
techInfoProvider.Registry(&lily)
techInfoProvider.Registry(&jacky)
updateKey := updates{}
updateValue := updates{topic: "cosmos", order: 1001}
updateContent := context.WithValue(context.Background(), updateKey, updateValue)
techInfoProvider.SetConext(updateContent)
techInfoProvider.noticeAllUpdate()
2020-04-21 22:50:21 +08:00
}