Ejemplo n.º 1
0
        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"});
        }
Ejemplo n.º 3
0
        public void AnnotateProperty()
        {
            var target = new ClassA();

            target.Annotate(() => target.FirstName, Suffix => "Mr");
            Assert.AreEqual("Mr", target.Annotation <string>(() => target.FirstName, "Suffix"));
        }
Ejemplo n.º 4
0
        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"));
 }
Ejemplo n.º 6
0
        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"));
        }
Ejemplo n.º 7
0
        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"));
 }