Example #1
0
        public void DoWork_when_IFooService_Update_returns_false_returns_false_StubVersion()
        {
            var service = new FooServiceFalseStub();

            using (var worker = new WorkerConstructorInjection(service))
            {
                var result = worker.DoWork(new FooDto());

                Assert.False(result);
            }
        }
Example #2
0
        public void DoWork_when_IFooService_Update_returns_false_returns_false_MockVersion()
        {
            var         mock    = new Mock <IFooService>();
            IFooService service = mock.Object;

            using (var worker = new WorkerConstructorInjection(service))
            {
                var result = worker.DoWork(new FooDto());

                Assert.False(result);
            }
        }
Example #3
0
        public void DoWork_when_IFooService_Update_returns_true_returns_true_MockVersion()
        {
            var mock = new Mock <IFooService>();

            mock.Setup(m => m.Update(It.IsAny <Foo>())).Returns(true);

            using (var worker = new WorkerConstructorInjection(mock.Object))
            {
                var result = worker.DoWork(new FooDto());

                Assert.True(result);
            }
        }