コード例 #1
0
        private static Lazy <ModelInspector> createDefaultModelInspector()
        {
            return(new Lazy <ModelInspector>(() =>
            {
                var result = new ModelInspector();
#if PORTABLE45
                result.Import(typeof(Resource).GetTypeInfo().Assembly);
#else
                result.Import(typeof(Resource).Assembly);
#endif
                return result;
            }));
        }
コード例 #2
0
        public void TestAssemblyInspection()
        {
            var inspector = new ModelInspector();

            // Inspect the HL7.Fhir.Model assembly
            inspector.Import(typeof(Resource).Assembly);

            // Check for presence of some basic ingredients
            Assert.IsNotNull(inspector.FindClassMappingForResource("patient"));
            Assert.IsNotNull(inspector.FindClassMappingForFhirDataType("HumanName"));
            Assert.IsNotNull(inspector.FindClassMappingForFhirDataType("code"));
            Assert.IsNotNull(inspector.FindClassMappingForFhirDataType("boolean"));

            // Verify presence of nested enumerations
            Assert.IsNotNull(inspector.FindEnumMappingByType(typeof(Address.AddressUse)));

            // Should have skipped abstract classes
            Assert.IsNull(inspector.FindClassMappingForResource("ComplexElement"));
            Assert.IsNull(inspector.FindClassMappingForResource("Element"));
            Assert.IsNull(inspector.FindClassMappingForResource("Resource"));

            // The open generic Code<> should not be there
            var codeOfT = inspector.FindClassMappingByType(typeof(Code <>));

            Assert.IsNull(codeOfT);
        }
コード例 #3
0
 private static Lazy <ModelInspector> createDefaultModelInspector()
 {
     return(new Lazy <ModelInspector>(() =>
     {
         var result = new ModelInspector();
         result.Import(typeof(Resource).Assembly);
         return result;
     }));
 }
コード例 #4
0
        public void TestAssemblyInspection()
        {
            var inspector = new ModelInspector(Specification.FhirRelease.STU3);

            // Inspect the HL7.Fhir.Model common assembly
            inspector.Import(typeof(Resource).GetTypeInfo().Assembly);

            // Check for presence of some basic ingredients
            Assert.IsNotNull(inspector.FindClassMapping("Meta"));
            Assert.IsNotNull(inspector.FindClassMapping(typeof(Code)));
            Assert.IsNotNull(inspector.FindClassMapping("boolean"));

            // Should also have found the abstract classes
            Assert.IsNotNull(inspector.FindClassMapping("Element"));
            Assert.IsNotNull(inspector.FindClassMapping(typeof(Resource)));

            // The open generic Code<> should not be there
            var codeOfT = inspector.FindClassMapping(typeof(Code <>));

            Assert.IsNull(codeOfT);
        }
コード例 #5
0
        public void TestAssemblyInspection()
        {
            var inspector = new ModelInspector();

            // Inspect the HL7.Fhir.Model assembly
            inspector.Import(typeof(Resource).GetTypeInfo().Assembly);

            // Check for presence of some basic ingredients
            Assert.IsNotNull(inspector.FindClassMappingForResource("patient"));
            Assert.IsNotNull(inspector.FindClassMappingForFhirDataType("HumanName"));
            Assert.IsNotNull(inspector.FindClassMappingForFhirDataType("code"));
            Assert.IsNotNull(inspector.FindClassMappingForFhirDataType("boolean"));

            // Should also have found the abstract classes
            Assert.IsNotNull(inspector.FindClassMappingForFhirDataType("Element"));
            Assert.IsNotNull(inspector.FindClassMappingForResource("Resource"));

            // The open generic Code<> should not be there
            var codeOfT = inspector.FindClassMappingByType(typeof(Code <>));

            Assert.IsNull(codeOfT);
        }
コード例 #6
0
 static FhirbaseJsonReader()
 {
     s_modelInspector = new ModelInspector();
     s_modelInspector.Import(typeof(Resource).Assembly);
 }