Example #1
0
        public void Should_throw_exception_if_limit_below_0()
        {
            var service = new SumOfMultipleCommand {
                LimiteAsString = "-1"
            };

            service.OnExecute(_consoleMock.Object);
        }
Example #2
0
        public void Should_throw_exception_if_limit_was_not_entered()
        {
            var service = new SumOfMultipleCommand {
                LimiteAsString = null
            };

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

            Assert.AreEqual(1, actual);
        }
Example #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"));
        }
Example #5
0
 public void Should_throw_exception_if_limit_was_not_valid(string limit)
 {
     var service = new SumOfMultipleCommand {
         LimiteAsString = limit
     };
 }