Exemple #1
0
        public void SumOfDigitsShouldWorkCorrectlyWithNegativeNumber()
        {
            var summator = new Summator();
            var result   = summator.SumOfDigits(-123);

            Assert.AreEqual(6, result);
        }
Exemple #2
0
        public void SumOfDigitsShouldWorkCorrectlyWithZero()
        {
            var summator = new Summator();
            var result   = summator.SumOfDigits(0);

            Assert.AreEqual(0, result);
        }
Exemple #3
0
        public void SumOfDigitsShouldWorkCorrectlyWithMillions()
        {
            var summator = new Summator();
            var result   = summator.SumOfDigits(1111111);

            Assert.AreEqual(7, result);
        }
Exemple #4
0
        public void SumOfDigitsShouldWorkCorrectlyWithLongNumber()
        {
            var summator = new Summator();
            var result   = summator.SumOfDigits(9876543210);

            Assert.AreEqual(45, result);
        }
Exemple #5
0
        public void SumOfDigitsShouldWorkCorrectlyForADigit()
        {
            // Arange
            var summator = new Summator();

            // Act
            var result = summator.SumOfDigits(8);

            // Assert
            Assert.AreEqual(8, result);
        }