コード例 #1
0
        public void Should_throw_exception_if_limit_was_not_entered()
        {
            var service = new SumOfMultipleCommand {
                LimiteAsString = null
            };

            service.OnExecute(_consoleMock.Object);
        }
コード例 #2
0
        public void Should_throw_exception_if_limit_below_0()
        {
            var service = new SumOfMultipleCommand {
                LimiteAsString = "-1"
            };

            service.OnExecute(_consoleMock.Object);
        }
コード例 #3
0
        public void Should_return_success()
        {
            var service = new SumOfMultipleCommand {
                LimiteAsString = "10"
            };
            var actual = service.OnExecute(_consoleMock.Object);

            Assert.AreEqual(1, actual);
        }
コード例 #4
0
        public void Should_execute_service(int limit)
        {
            var service = new SumOfMultipleCommand {
                LimiteAsString = limit.ToString()
            };

            var expected = new Domain.SumOfMultiple().Execute(limit);

            service.OnExecute(_consoleMock.Object);

            _consoleMock.VerifyWriteLine(expected.ToString("#,##0"));
        }