public void MockAbstractMethod() { AbsCls ac = (AbsCls)mocks.StrictMock(typeof(AbsCls)); Expect.Call(ac.Method()).Return(45); mocks.ReplayAll(); Assert.Equal(45, ac.Method()); }
public void ProxyAnAbstractClass() { ProxyGenerator generator = new ProxyGenerator(); LoginInterceptor interceptor = new LoginInterceptor(); AbsCls ac = (AbsCls)generator.CreateClassProxy(typeof(AbsCls), interceptor, false); ac.Method(); Assert.AreEqual("Method", interceptor.Methods[0]); }
public void MockAbstractMethod() { AbsCls ac = MockRepository.Mock <AbsCls>(); ac.Expect(x => x.Method()) .Return(45); Assert.Equal(45, ac.Method()); ac.VerifyAllExpectations(); }
public void MockAbstractMethod() { AbsCls ac = MockRepository.Mock <AbsCls>(); ac.SetUnexpectedBehavior(UnexpectedCallBehaviors.BaseOrDefault); ac.Expect(x => x.Method()) .Return(45); Assert.Equal(45, ac.Method()); ac.VerifyAllExpectations(); }