Example #1
0
        public void ShouldReturnNumberIfNumberIsAMultipleOfFive()
        {
            //When
            var result = MultiplesOfThreeAndFive.GetMultipleOfThreeAndFive(10);

            //Then
            Assert.Contains(5, result);
        }
Example #2
0
        public void ShouldCalulcateTheSumOfMultplesOfThreeAndFive()
        {
            //When
            var result = MultiplesOfThreeAndFive.SumOfMultipleOfThreeAndFive(1000);

            //Then
            const int expectedSum = 233168;

            Assert.Equal(expectedSum, result);
        }
Example #3
0
        public void ShouldNotContainDuplicateMultipleFactors()
        {
            //When
            var result = MultiplesOfThreeAndFive.GetMultipleOfThreeAndFive(15);

            //Then
            var distinctAmount = result.Distinct().Count();

            Assert.Equal(distinctAmount, result.Count);
        }
Example #4
0
        public void ShouldReturnAllMultipleOfThreeAndFiveBelow1000()
        {
            //When
            var result = MultiplesOfThreeAndFive.GetMultipleOfThreeAndFive(1000);

            //Then
            Assert.Contains(3, result);
            Assert.Contains(5, result);
            Assert.Contains(6, result);
            Assert.Contains(9, result);
        }
        public void MultiplesOfThreeAndFive_ForGivenNumbers_ReturnsExpectedSum()
        {
            // Arrange
            const int ExpectedSum = 23;

            // Act
            var result = MultiplesOfThreeAndFive.CalculateSumOfThreeAndFiveMultiples(1, 10);

            // Assert
            result.ShouldBe(ExpectedSum);
        }
Example #6
0
        public void FindSumOfAllMultiplesOfThreeOrFive_ShouldWork(int expected, int total)
        {
            int actual = MultiplesOfThreeAndFive.SumOfAllMultiplesOfThreeOrFive(total);

            Assert.Equal <int>(expected, actual);
        }