예제 #1
0
        public void TestAnnotationsAreCloneable()
        {
            FhirBoolean data = new FhirBoolean(true);

            data.AddAnnotation(new AnnotationData {
                Data = "Hi!"
            });

            var copied = (FhirBoolean)data.DeepCopy();

            Assert.AreEqual("Hi!", copied.Annotation <AnnotationData>().Data);
        }
예제 #2
0
        public void TestAnnotationsEnumType()
        {
            FhirBoolean data = new FhirBoolean(true);

            data.SetAnnotation(SummaryType.True);

            var copied = (FhirBoolean)data.DeepCopy();

            Assert.AreEqual(SummaryType.True, copied.Annotation <SummaryType>());

            copied.SetAnnotation(SummaryType.Text);
            Assert.AreEqual(SummaryType.Text, copied.Annotation <SummaryType>());

            Assert.IsTrue(copied.HasAnnotation <SummaryType>());

            copied.RemoveAnnotations <SummaryType>();

            Assert.IsFalse(copied.HasAnnotation <SummaryType>());
        }