Пример #1
0
        public void Target_Member_Type_Element_and_Exclude()
        {
            var t2 = new ComplexClass4.NestedClass.NestedClass1();

            calls.Clear();
            t2.SimpleMethod();
            t2.SimpleMethod2();
            t2.Prop2 = 42;
            Assert.Empty(calls);

            t2.SimpleMethod1();
            t2.Prop1 = 42;
            Assert.Equal(new[] { "ComplexClass4", "ComplexClass4" }, calls);

            var t3 = new ComplexClass4.NestedClass.NestedClass2();

            calls.Clear();
            t2.SimpleMethod();
            t3.SimpleMethod2();
            t3.Prop2 = 42;
            Assert.Empty(calls);

            t3.SimpleMethod1();
            t3.Prop1 = 42;
            Assert.Equal(new[] { "ComplexClass4", "ComplexClass4" }, calls);
        }
Пример #2
0
        public void Target_Member_Type_Element_and_Exclude()
        {
            var t2 = new ComplexClass4.NestedClass.NestedClass1();
            calls.Clear();
            t2.SimpleMethod();
            t2.SimpleMethod2();
            t2.Prop2 = 42;
            Assert.Empty (calls);

            t2.SimpleMethod1();
            t2.Prop1 = 42;
            Assert.Equal (new[] {"ComplexClass4", "ComplexClass4"}, calls);

            var t3 = new ComplexClass4.NestedClass.NestedClass2();
            calls.Clear();
            t2.SimpleMethod();
            t3.SimpleMethod2();
            t3.Prop2 = 42;
            Assert.Empty (calls);

            t3.SimpleMethod1();
            t3.Prop1 = 42;
            Assert.Equal (new[] {"ComplexClass4", "ComplexClass4"}, calls);
        }