示例#1
0
        [Test] public void CanBeCustomisedByOverridingCallMethod()
        {
            IMock mock = new CustomMock(typeof(IBlah));
            IBlah blah = (IBlah)mock.MockInstance;

            Assertion.AssertEquals("CUSTOM", blah.DoStuff("hello"));
            mock.Verify();
        }
示例#2
0
        [Test] public void NamedDynamicMockImplementsAnInterface()
        {
            IMock mock = new DynamicMock(typeof(IBlah), "XBlah");

            mock.ExpectAndReturn("DoStuff", "world", "hello");

            IBlah blah = (IBlah)mock.MockInstance;

            Assertion.AssertEquals("world", blah.DoStuff("hello"));

            mock.Verify();
        }