示例#1
0
        public void Prig_should_assert_call_on_void_through_an_interface()
        {
            using (new IndirectionsContext())
            {
                // Arrange
                var called = false;
                PFoo.Execute().Body = @this => called = true;
                var foo = new Foo();


                // Act
                var iFoo = (IFoo)foo;
                iFoo.Execute();


                // Assert
                Assert.IsTrue(called);
            }
        }
示例#2
0
        public void Prig_should_assert_call_on_void_through_an_explict_implemented_interface()
        {
            using (new IndirectionsContext())
            {
                // Arrange
                var called = false;
                PFoo.SealedMockingMigrationIFooExecuteInt32().Body = (@this, arg1) => called = true;
                var foo = new Foo();


                // Act
                var iFoo = (IFoo)foo;
                iFoo.Execute(1);


                // Assert
                Assert.IsTrue(called);
            }
        }