public void WhenHeathVaultApproximateTimeTransformedToFhir_ThenValuesEqual()
        {
            var approximateTime = new ApproximateTime(1, 2, 3, 4);

            var fhirTime = approximateTime.ToFhir();

            Assert.IsNotNull(fhirTime);
            Assert.IsNotNull("01:02:03.004", fhirTime.Value);
        }
Exemple #2
0
        public void WhenHeathVaultApproximateTimeTransformedToFhir_ThenValuesEqual()
        {
            var testTime        = new LocalTime(10, 17, 16, 115);
            var approximateTime = new ApproximateTime(testTime);

            var fhirTime = approximateTime.ToFhir();

            Assert.IsNotNull(fhirTime);
            Assert.AreEqual(testTime.ToString(@"hh\:mm\:ss\.fff", null), fhirTime.Value);
        }
Exemple #3
0
        public void WhenHealthVaultApproximateTimePartialTransformedToFhir_ThenValuesEqual()
        {
            var testTime0 = new ApproximateTime();
            var fhirTime0 = testTime0.ToFhir();

            Assert.AreEqual("00:00:00.000", fhirTime0.Value);

            var testTime1 = new ApproximateTime(1, 1);
            var fhirTime1 = testTime1.ToFhir();

            Assert.AreEqual("01:01:00.000", fhirTime1.Value);

            var testTime2 = new ApproximateTime(2, 2, 2);
            var fhirTime2 = testTime2.ToFhir();

            Assert.AreEqual("02:02:02.000", fhirTime2.Value);

            var testTime3 = new ApproximateTime(3, 3, 3, 3);
            var fhirTime3 = testTime3.ToFhir();

            Assert.AreEqual("03:03:03.003", fhirTime3.Value);
        }
        public void WhenHeathVaultApproximateTimePartialTransformedToFhir_ThenValuesEqual()
        {
            // Only hours, minutes
            var approximateTime1 = new ApproximateTime(23, 59);
            var fhirTime1        = approximateTime1.ToFhir();

            Assert.IsNotNull(fhirTime1);
            Assert.IsNotNull("23:59:00.000", fhirTime1.Value);

            // Only hours, minutes, seconds
            var approximateTime2 = new ApproximateTime(23, 59, 59);
            var fhirTime2        = approximateTime2.ToFhir();

            Assert.IsNotNull(fhirTime2);
            Assert.IsNotNull("23:59:59.000", fhirTime2.Value);

            // Only hours, minutes, seconds, milliseconds
            var approximateTime3 = new ApproximateTime(23, 59, 59, 999);
            var fhirTime3        = approximateTime3.ToFhir();

            Assert.IsNotNull(fhirTime3);
            Assert.IsNotNull("23:59:59.999", fhirTime2.Value);
        }