public void AccessAnnotationDirectly() { var target = new ClassA(); target.Annotation()["Tags"] = new[] { "C#", "Tests" }; CollectionAssert.AreEqual(target.Annotation <string[]>("Tags"), new[] { "C#", "Tests" }); }
public void AccessAnnotationDirectly() { var target = new ClassA(); target.Annotation()["Tags"] = new[] {"C#", "Tests"}; CollectionAssert.AreEqual(target.Annotation<string[]>("Tags"), new[] {"C#", "Tests"}); }
public void AnnotateProperty() { var target = new ClassA(); target.Annotate(() => target.FirstName, Suffix => "Mr"); Assert.AreEqual("Mr", target.Annotation <string>(() => target.FirstName, "Suffix")); }
public void AnnotateClass() { var target = new ClassA(); target.Annotate(Description => "instance we are testing"); Assert.AreEqual("instance we are testing", target.Annotation <string>("Description")); }
public void AnnotateNonOwnedProperty() { var targetA = new ClassA(); var targetB = new ClassB(); targetA.Annotate(() => targetB.FirstName, Suffix => "Mr"); Assert.AreEqual("Mr", targetA.Annotation<string>(() => targetB.FirstName, "Suffix")); }
public void AnnotateNonOwnedProperty() { var targetA = new ClassA(); var targetB = new ClassB(); targetA.Annotate(() => targetB.FirstName, Suffix => "Mr"); Assert.AreEqual("Mr", targetA.Annotation <string>(() => targetB.FirstName, "Suffix")); }
public void AnnotateDifferentInstances() { var target1 = new ClassA(); var target2 = new ClassA(); target1.Annotate(Description => "class number 1"); target2.Annotate(Description => "class number 2"); Assert.AreEqual("class number 1", target1.Annotation <string>("Description")); Assert.AreEqual("class number 2", target2.Annotation <string>("Description")); }
public void AnnotateDifferentInstances() { var target1 = new ClassA(); var target2 = new ClassA(); target1.Annotate(Description => "class number 1"); target2.Annotate(Description => "class number 2"); Assert.AreEqual("class number 1", target1.Annotation<string>("Description")); Assert.AreEqual("class number 2", target2.Annotation<string>("Description")); }
public void AnnotateProperty() { var target = new ClassA(); target.Annotate(() => target.FirstName, Suffix => "Mr"); Assert.AreEqual("Mr", target.Annotation<string>(() => target.FirstName, "Suffix")); }
public void AnnotateClass() { var target = new ClassA(); target.Annotate(Description => "instance we are testing"); Assert.AreEqual("instance we are testing", target.Annotation<string>("Description")); }