public static void Main()
    {
        Tester tester = new Tester();

        IFoo iFoo = (IFoo)tester;

        iFoo.Execute();

        IBar iBar = (IBar)tester;

        iBar.Execute();
    }
Example #2
0
        public void ShouldAssertCallOnVoidThroughAnInterface()
        {
            bool isCalled = false;

            // ARRANGE
            // Creating a mock instance of the "Foo" class (sealed class).
            var foo = Mock.Create <Foo>();

            // Arranging: When foo.Execute() is called, it should assign true to the isCalled boolean instead.
            Mock.Arrange(() => foo.Execute()).DoInstead(() => isCalled = true);

            // ACT - Acting through the IFoo interface.
            IFoo iFoo = foo;

            iFoo.Execute();

            // ASSERT
            Assert.IsTrue(isCalled);
        }
Example #3
0
 public void Foo()
 {
     foo.Execute();
     foo.LowCommon();
     foo.MakeFoo();
 }