public T Service <T>() where T : class
        {
            var instance = (T)_mocks.DynamicMock(typeof(T));

            _mocks.Replay(instance);
            return(instance);
        }
        public void can_make_dynamic_mocks()
        {
            var mockRepository = new RhinoMockRepositoryProxy();
            object fooMock = mockRepository.DynamicMock(typeof (ITestMocks));

            fooMock.ShouldNotBeNull();
        }
        public void can_put_mock_in_replay_mode()
        {
            var mockRepository = new RhinoMockRepositoryProxy();
            var test = (ITestMocks) mockRepository.DynamicMock(typeof (ITestMocks));

            mockRepository.Replay(test);

            test.Stub(t => t.Answer()).Return("YES");
            test.ShouldNotBeNull();
            test.Answer().ShouldEqual("YES");
        }
Example #4
0
 public T Service <T>() where T : class
 {
     return((T)_mocks.DynamicMock(typeof(T)));
 }