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); }
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>()); }