예제 #1
0
        public void Should_Return_Sum_Of_Arguments()
        {
            StringSumUtility ssu = new StringSumUtility();
            var result           = ssu.Sum("1", "2");

            result.Should().Be("3");
        }
예제 #2
0
        public void Should_Return_Zero_If_Both_Nums_Not_Natural()
        {
            StringSumUtility ssu = new StringSumUtility();
            var result           = ssu.Sum("asd", "asd");

            result.Should().Be("0");
        }
예제 #3
0
        public void Should_Return_One_Argument_If_Another_Is_Not_Natural()
        {
            StringSumUtility ssu = new StringSumUtility();
            var result           = ssu.Sum("asd", "13");

            result.Should().Be("13");
        }
예제 #4
0
        public void Should_Throw_ArgumentException_If_Argument_Is_Whitespace()
        {
            StringSumUtility ssu    = new StringSumUtility();
            Action           action = () => ssu.Sum(" ", "1");

            action.Should().ThrowExactly <ArgumentException>();
        }