Example #1
0
        public void GivenValidTemplate_WhenCreateValue_ThenSampledDataProperlyConfigured_Test()
        {
            var processor = new QuantityFhirValueProcessor();
            var template  = new QuantityFhirValueType
            {
                Unit   = "myUnit",
                System = "mySystem",
                Code   = "myCode",
            };

            var data   = (DateTime.Now, DateTime.UtcNow, new (DateTime, string)[] { (DateTime.UtcNow, "22.4") });
Example #2
0
        public void GivenValidTemplate_WhenCreateValue_ThenSampledDataProperlyConfigured_Test()
        {
            var processor = new QuantityFhirValueProcessor();
            var template  = new QuantityFhirValueType
            {
                Unit   = "myUnit",
                System = "mySystem",
                Code   = "myCode",
            };

            var data = Substitute.For <IObservationData>()
                       .Mock(m => m.DataPeriod.Returns((DateTime.UtcNow, DateTime.UtcNow)))
                       .Mock(m => m.Data.Returns(new (DateTime, string)[] { (DateTime.UtcNow, "22.4") }));
Example #3
0
        public void GivenValidTemplate_WhenMergeValue_ThenImplInvoked_Test()
        {
            var template  = new QuantityFhirValueType();
            var processor = Substitute.ForPartsOf <TestFhirValueProcessor>();

            processor.TestMergeValueImpl(null, null, null).ReturnsForAnyArgs(string.Empty);

            var result = processor.MergeValue(template, "1", "2");

            Assert.Equal(string.Empty, result);

            processor.Received(1).TestMergeValueImpl(template, "1", "2");
        }