Example #1
0
        public void TestTryFhirReleaseFromCorePackageName()
        {
            FhirRelease?version = null;

            Assert.AreEqual(true, FhirReleaseParser.TryFhirReleaseFromCorePackageName("hl7.fhir.r3.core", out version));
            Assert.AreEqual(FhirRelease.STU3, version);
            Assert.AreEqual(true, FhirReleaseParser.TryFhirReleaseFromCorePackageName("hl7.fhir.r4.core", out version));
            Assert.AreEqual(FhirRelease.R4, version);
            Assert.AreEqual(true, FhirReleaseParser.TryFhirReleaseFromCorePackageName("hl7.fhir.r5.core", out version));
            Assert.AreEqual(FhirRelease.R5, version);

            Assert.AreEqual(false, FhirReleaseParser.TryFhirReleaseFromMimeVersion("hl7.fhir.core.r3", out version));
            Assert.IsNull(version);
        }
Example #2
0
        public void TestTryFhirVersionFromMimeVersion()
        {
            FhirRelease?version = null;

            Assert.AreEqual(true, FhirReleaseParser.TryFhirReleaseFromMimeVersion("0.0", out version));
            Assert.AreEqual(FhirRelease.DSTU1, version);
            Assert.AreEqual(true, FhirReleaseParser.TryFhirReleaseFromMimeVersion("1.0", out version));
            Assert.AreEqual(FhirRelease.DSTU2, version);
            Assert.AreEqual(true, FhirReleaseParser.TryFhirReleaseFromMimeVersion("3.0", out version));
            Assert.AreEqual(FhirRelease.STU3, version);
            Assert.AreEqual(true, FhirReleaseParser.TryFhirReleaseFromMimeVersion("4.0", out version));
            Assert.AreEqual(FhirRelease.R4, version);
            Assert.AreEqual(true, FhirReleaseParser.TryFhirReleaseFromMimeVersion("5.0", out version));
            Assert.AreEqual(FhirRelease.R5, version);

            Assert.AreEqual(false, FhirReleaseParser.TryFhirReleaseFromMimeVersion("0.0.0.0.1", out version));
            Assert.IsNull(version);
        }