Пример #1
0
        public void MethodRefTest()
        {
            OutAndRefImplementation obj     = new OutAndRefImplementation();
            BeethovenFactory        factory = new BeethovenFactory();
            ITestMethods            test    = factory.Generate <ITestMethods>(obj);
            int value = 4;

            test.Ref(ref value);
            Assert.AreEqual(5, value);
        }
Пример #2
0
        public void MethodMultiObjects()
        {
            SimpleImplementation    obj1    = new SimpleImplementation();
            OutAndRefImplementation obj2    = new OutAndRefImplementation();
            BeethovenFactory        factory = new BeethovenFactory();
            ITestMethods            test    = factory.Generate <ITestMethods>(obj1, obj2);
            string text1 = "abc";

            Assert.AreEqual(19, test.OutAndRef(out string _, ref text1, 5));
            test.Simple();
        }
Пример #3
0
        public void MethodOutAndRef()
        {
            OutAndRefImplementation obj     = new OutAndRefImplementation();
            BeethovenFactory        factory = new BeethovenFactory();
            ITestMethods            test    = factory.Generate <ITestMethods>(obj);
            string text1 = "abc";

            Assert.AreEqual(19, test.OutAndRef(out string text2, ref text1, 5));
            Assert.AreEqual("cba", text1);
            Assert.AreEqual("abc abc abc abc abc", text2);
        }