public void ShallReturnPatient() { var xml = XDocument.Load("C-CDA_R2-1_CCD.xml"); var element = xml.Root.CdaElement("recordTarget")?.CdaElement("patientRole")?.CdaElement("patient")?.CdaElement("guardian"); var result = new RelatedPersonParser().FromXml(element); result.Should().NotBeNull(); // Shall have id result.Id.Should().NotBeNullOrEmpty(); result.Name.Count.Should().BeGreaterThan(0); result.Name.All(n => !string.IsNullOrEmpty(n.Family) && n.Given.Any()).Should().BeTrue(); }
public void NullElementShallReturnNull() { var result = new RelatedPersonParser().FromXml(null); result.Should().BeNull(); }