示例#1
0
        public void TestReadCurrentUser()
        {
            var state = tree.ReadCurrentUser();

            Assert.DoesNotThrow(() => state.IfSuccessful());
            Assert.AreEqual(HttpStatusCode.OK, state.Response.StatusCode);
        }
示例#2
0
        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);
        }