public void TestCreateComment() { var discussion = (DiscussionState)tree.AddDiscussion(new Discussion().SetTitle("Comment").SetDetails("Comment")).Get(); cleanup.Add(discussion); var state = discussion.AddComment(new Comment().SetText("Comment")); Assert.DoesNotThrow(() => state.IfSuccessful()); Assert.AreEqual(HttpStatusCode.Created, state.Response.StatusCode); }
public void TestCreateDiscussionReference() { var me = tree.ReadCurrentUser(); var contributor = new ResourceReference("https://familysearch.org/platform/users/agents/" + me.User.TreeUserId).SetResourceId(me.User.TreeUserId); var discussion = tree.AddDiscussion(new Discussion() .SetTitle("Test title") .SetDetails("Test details") .SetContributor(contributor) .SetCreated(DateTime.Now)); cleanup.Add(discussion); var person = (FamilyTreePersonState)tree.AddPerson(TestBacking.GetCreateMalePerson()).Get(); cleanup.Add(person); var state = person.AddDiscussionReference(discussion); Assert.DoesNotThrow(() => state.IfSuccessful()); Assert.AreEqual(HttpStatusCode.Created, state.Response.StatusCode); }