public void FileSourceSkipsInvalidXml() { var fa = new DirectorySource(_testPath); fa.Mask = "*.xml"; var names = fa.ListArtifactNames(); Assert.AreEqual(4, names.Count()); Assert.IsTrue(names.Contains("extension-definitions.xml")); Assert.IsTrue(names.Contains("TestPatient.xml")); Assert.IsTrue(names.Contains("nonfhir.xml")); Assert.IsTrue(names.Contains("invalid.xml")); Assert.AreEqual(0, fa.Errors.Length); // Call a method on the IConformanceSource interface to trigger prepareResources var sd = fa.FindStructureDefinition("http://hl7.org/fhir/StructureDefinition/qicore-adverseevent-discoveryDateTime"); Assert.IsNotNull(sd); Assert.AreEqual(1, fa.Errors.Length); var error = fa.Errors[0]; Debug.Print($"{error.FileName} : {error.Error.Message}"); Assert.AreEqual("invalid.xml", Path.GetFileName(error.FileName)); }