Ejemplo n.º 1
0
        public void ShouldBeAbleToCombineMultipleDynamicObjects()
        {
            var firstInstance  = new FirstClass();
            var secondInstance = new SecondClass();
            var first          = new DynamicObject(firstInstance);
            var second         = new DynamicObject(secondInstance);

            var combined = first + second;

            combined.Methods["TestMethod1"]();
            combined.Methods["TestMethod2"]();

            Assert.AreEqual(1, firstInstance.CallCount);
            Assert.AreEqual(1, secondInstance.CallCount);
        }
        public void ShouldBeAbleToCombineMultipleDynamicObjects()
        {
            FirstClass firstInstance = new FirstClass();
            SecondClass secondInstance = new SecondClass();
            DynamicObject first = new DynamicObject(firstInstance);
            DynamicObject second = new DynamicObject(secondInstance);

            DynamicObject combined = first + second;
            combined.Methods["TestMethod1"]();
            combined.Methods["TestMethod2"]();

            Assert.AreEqual(1, firstInstance.CallCount);
            Assert.AreEqual(1, secondInstance.CallCount);
        }