Beispiel #1
0
        protected override void Given()
        {
            instance = MockRepository.GenerateStub <TestInterface>();

            instance.Expect(x => x.Method(null)).Throw(exception);
            instance.Expect(x => x.Function(null)).Throw(exception);

            command = new AsyncCommand(() => instance.Method(null));
            query   = new AsyncQuery <string>(() => instance.Function(null));
        }
Beispiel #2
0
        protected override void Given()
        {
            instance = MockRepository.GenerateStrictMock <TestInterface>();

            instance.Expect(x => x.Method(parameter))
            .WhenCalled(x => callThreadId = CurrentThreadId());

            instance.Expect(x => x.Function(parameter)).Return(result)
            .WhenCalled(x => callThreadId = CurrentThreadId());;

            command = new AsyncCommand(() => instance.Method(parameter));
            query   = new AsyncQuery <string>(() => instance.Function(parameter));
        }