public void SlicingValid() { var resource = FhirFile.LoadResource("TestData\\lipid.slice.valid.xml"); Report report = spec.Validate(resource); Assert.IsTrue(report.IsValid); }
public void CorrectFixedValue() { var resource = FhirFile.LoadResource("TestData\\lipid.fixvalue.xml"); Report report = lipidSpec.Validate(resource); Assert.IsTrue(report.IsValid); }
public void Extensions() { Specification spec = Factory.GetExtendedPatientSpec(expand: false, online: false); var resource = FhirFile.LoadResource("TestData\\patient.extended.valid.xml"); Report report = spec.Validate(resource); Assert.IsTrue(report.IsValid); }
public void Extensions() { Specification patientSpec = Factory.GetPatientExtendedSpec(); var resource = FhirFile.LoadResource("TestData\\patient.extended.valid.xml"); Report report = patientSpec.Validate(resource); Assert.IsTrue(report.IsValid); }
public void ValidResource() { var resource = FhirFile.LoadResource("TestData\\Patient.Valid.xml"); Report report = spec.Validate(resource); var errors = report.Errors; Assert.IsTrue(report.IsValid); }
public void InvalidElement() { var resource = FhirFile.LoadResource("TestData\\Patient.InvalidElement.xml"); Report report = patientSpec.Validate(resource); Assert.IsFalse(report.IsValid); Assert.AreEqual(1, report.ErrorCount); Assert.IsTrue(report.Contains(Group.Element, Status.Unknown)); }
public void ConstraintError() { var resource = FhirFile.LoadResource("TestData\\Patient.ConstraintError.xml"); Report report = spec.Validate(resource); Assert.IsFalse(report.IsValid); Assert.AreEqual(1, report.ErrorCount); Assert.IsTrue(report.Contains(Group.Constraint, Status.Failed)); }
public void IncorrectFixedValue() { var resource = FhirFile.LoadResource("TestData\\lipid.fixvalue.wrong.xml"); Report report = lipidSpec.Validate(resource); Assert.IsFalse(report.IsValid); Assert.AreEqual(1, report.ErrorCount); Assert.IsTrue(report.Contains(Group.Value, Status.Failed)); }
public void Expanded() { var resource = FhirFile.LoadResource("TestData\\lipid.profile.expanded.xml"); Report report = Validation.Validate(resource); var errors = report.Errors.ToList(); Assert.IsTrue(report.IsValid); }
public void WrongRootElement() { var resource = FhirFile.LoadResource("TestData\\invalidroot.xml"); Report report = spec.Validate(resource); Assert.IsFalse(report.IsValid); Assert.AreEqual(1, report.ErrorCount); Assert.IsTrue(report.Contains(Group.Structure, Status.Unknown)); }
public void CardinalityTooLittle() { var resource = FhirFile.LoadResource("TestData\\Patient.CardinalityMinus.xml"); Report report = spec.Validate(resource); Assert.IsFalse(report.IsValid); Assert.IsTrue(report.Contains(Group.Cardinality, Status.Failed)); Assert.AreEqual(1, report.ErrorCount); }
public void Constraint() { // <constraint value="f:name or f:telecom or f:address or f:organization"/> var resource = FhirFile.LoadResource("TestData\\Patient.ConstraintError.xml"); Report report = spec.Validate(resource); Assert.IsFalse(report.IsValid); Assert.AreEqual(1, report.ErrorCount); Assert.IsTrue(report.Contains(Group.Constraint, Status.Failed)); }
public void SlicingInvalid() { var resource = FhirFile.LoadResource("TestData\\lipid.slice.invalid.xml"); Report report = spec.Validate(resource); Assert.IsFalse(report.IsValid); Assert.AreEqual(4, report.ErrorCount); Assert.IsTrue(report.Contains(Group.Cardinality, Status.Failed)); Assert.IsTrue(report.Contains(Group.Slice, Status.Failed)); }
public void ValueSet_UnknownValue() { var resource = FhirFile.LoadResource("TestData\\Patient.ErrorUse.xml"); Report report = spec.Validate(resource); // todo: bugfix ValueSet resolving // This validation should fail because the name use "unofficial" does not exist // However, the ProfileExpander/Resolver is not yet loading ValueSets, so ValueSet validation cannot take place. // As a result, the validation reports an unresolved error instead of a coding failed error. Assert.IsFalse(report.IsValid); Assert.IsTrue(report.Contains(Group.Coding, Status.Failed)); Assert.AreEqual(1, report.ErrorCount); }
public void NamespaceXHtml() { var resource = FhirFile.LoadResource("TestData\\Patient.Narrative.correct.xml"); Report report = spec.Validate(resource); //report.Errors.ToConsole(); Assert.IsTrue(report.IsValid); // In this narrative node, the div element does not contain a xhtml namespace and should not be found by the validator resource = FhirFile.LoadResource("TestData\\Patient.Narrative.wrong.xml"); report = spec.Validate(resource); //report.Errors.ToConsole(); Assert.IsFalse(report.IsValid); Assert.IsTrue(report.Contains(Group.Cardinality, Status.Failed)); Assert.AreEqual(1, report.ErrorCount); }