public void ReadHeadForAPerson() { var ft = new FamilySearchSDK(Settings.Default.UserName, Settings.Default.Password, Settings.Default.ApplicationKey, TestBacking.AppName, TestBacking.AppVersion, Gedcomx.Api.Lite.Environment.Integration); // Create a Person var gedcomx = new Gx.Gedcomx(); gedcomx.AddPerson(TestBacking.GetCreateMalePerson()); var postResults = ft.Post("/platform/tree/persons", JsonConvert.SerializeObject(gedcomx), MediaType.X_GEDCOMX_v1_JSON).Result; // Now get the new person. string personId = ((string[])postResults.Headers.Location.ToString().Split('/')).Last(); var response = ft.Head("/platform/tree/persons/" + personId, MediaType.APPLICATION_JSON).Result; Assert.IsTrue(response.StatusCode == HttpStatusCode.OK, "Resonse should indicate header retreived successfully"); }
public void GetAPerson() { var ft = new FamilySearchSDK(Settings.Default.UserName, Settings.Default.Password, Settings.Default.ApplicationKey, TestBacking.AppName, TestBacking.AppVersion, Gedcomx.Api.Lite.Environment.Integration); // Create a Person var gedcomx = new Gx.Gedcomx(); gedcomx.AddPerson(TestBacking.GetCreateMalePerson()); var postResults = ft.Post("/platform/tree/persons", JsonConvert.SerializeObject(gedcomx), MediaType.X_GEDCOMX_v1_JSON).Result; // Now get the new person. string personId = ((string[])postResults.Headers.Location.ToString().Split('/')).Last(); var response = ft.Get("/platform/tree/persons/" + personId).Result; Assert.IsNotNull(response.persons, "resonse should contain a person"); }
public void GetAPortrait() { var ft = new FamilySearchSDK(Settings.Default.UserName, Settings.Default.Password, Settings.Default.ApplicationKey, TestBacking.AppName, TestBacking.AppVersion, Gedcomx.Api.Lite.Environment.Integration); // Create a Person var gedcomx = new Gx.Gedcomx(); gedcomx.AddPerson(TestBacking.GetCreateMalePerson()); var postResults = ft.Post("/platform/tree/persons", JsonConvert.SerializeObject(gedcomx), MediaType.X_GEDCOMX_v1_JSON).Result; // Now get the new person. string personId = ((string[])postResults.Headers.Location.ToString().Split('/')).Last(); var portraitResponse = ft.Get($"/platform/tree/persons/{personId}/portrait", MediaType.X_FS_v1_JSON); var portrait = portraitResponse.Result; Assert.IsTrue(postResults.StatusCode == HttpStatusCode.Created, "Portrait should flag the reply as created"); }
public static Gx.Gedcomx GetGedcomxObjectForDeepCompare() { return(new Gx.Gedcomx() { Persons = new List <Gx.Conclusion.Person>() { TestBacking.GetPersonForDeepCompare() }, Relationships = new List <Gx.Conclusion.Relationship>(), SourceDescriptions = new List <Gx.Source.SourceDescription>(), Agents = new List <Gx.Agent.Agent>(), Events = new List <Gx.Conclusion.Event>(), Places = new List <Gx.Conclusion.PlaceDescription>(), Documents = new List <Gx.Conclusion.Document>(), Collections = new List <Gx.Records.Collection>(), Fields = new List <Gx.Records.Field>(), RecordDescriptors = new List <Gx.Records.RecordDescriptor>(), Links = new List <Gx.Links.Link>(), ExtensionElementsXml = new List <object>(), }); }