Changes
2 changed files (+58/-1)
-
-
@@ -186,5 +186,5 @@ func (p Person) Object() apObject {// Link returns the Link corresponding to the Person object func (p Person) Link() Link { return p.Link() return Link{} }
-
-
-
@@ -1,6 +1,7 @@package activitypub import ( "reflect" "testing" )
-
@@ -98,3 +99,59 @@ func TestValidActorType(t *testing.T) {} } } func TestActor_IsLink(t *testing.T) { m := ActorNew("test", ActorType) if m.IsLink() { t.Errorf("%#v should not be a valid Link", m.Type) } } func TestActor_IsObject(t *testing.T) { m := ActorNew("test", ActorType) if !m.IsObject() { t.Errorf("%#v should be a valid object", m.Type) } } func TestActor_Object(t *testing.T) { m := ActorNew("test", ActorType) if reflect.DeepEqual(apObject{}, m.Object()) { t.Errorf("%#v should not be an empty activity pub object", m.Object()) } } func TestActor_Link(t *testing.T) { m := ActorNew("test", ActorType) if !reflect.DeepEqual(Link{}, m.Link()) { t.Errorf("%#v should be an empty Link object", m.Link()) } } func TestPerson_IsLink(t *testing.T) { m := PersonNew("test") if m.IsLink() { t.Errorf("%#v should not be a valid Link", m.Type) } } func TestPerson_IsObject(t *testing.T) { m := PersonNew("test") if !m.IsObject() { t.Errorf("%#v should be a valid object", m.Type) } } func TestPerson_Object(t *testing.T) { m := PersonNew("test") if reflect.DeepEqual(apObject{}, m.Object()) { t.Errorf("%#v should not be an empty activity pub object", m.Object()) } } func TestPerson_Link(t *testing.T) { m := PersonNew("test") if !reflect.DeepEqual(Link{}, m.Link()) { t.Errorf("%#v should be an empty Link object", m.Link()) } }
-