public void GivenValidTemplate_WhenCreateValue_ThenSampledDataProperlyConfigured_Test() { var processor = new CodeableConceptFhirValueProcessor(); var template = new CodeableConceptFhirValueType { Text = "myText", Codes = new List <FhirCode> { new FhirCode { Code = "c1", Display = "d1", System = "s1" }, new FhirCode { Code = "c2", Display = "d2", System = "s2" }, }, }; var data = (DateTime.Now, DateTime.UtcNow, new (DateTime, string)[] { (DateTime.UtcNow, "value") });
public void GivenValidTemplate_WhenCreateValue_ThenSampledDataProperlyConfigured_Test() { var processor = new CodeableConceptFhirValueProcessor(); var template = new CodeableConceptFhirValueType { Text = "myText", Codes = new List <FhirCode> { new FhirCode { Code = "c1", Display = "d1", System = "s1" }, new FhirCode { Code = "c2", Display = "d2", System = "s2" }, }, }; var data = Substitute.For <IObservationData>() .Mock(m => m.DataPeriod.Returns((DateTime.UtcNow, DateTime.UtcNow))) .Mock(m => m.Data.Returns(new (DateTime, string)[] { (DateTime.UtcNow, "value") }));
public void GivenInvalidElementType_WhenMergeValue_ThenNotSupportedExceptionThrown_Test() { var processor = new CodeableConceptFhirValueProcessor(); var template = new CodeableConceptFhirValueType(); Assert.Throws<NotSupportedException>(() => processor.MergeValue(template, default, new FhirDateTime()));