Beispiel #1
0
        public void TestMultipleThree_Positive()
        {
            // Create a list of integers that are multiples of 3
            List <int> threes = new List <int>();

            for (int value = 3; value < 100; value += 3)
            {
                threes.Add(value);
            }

            // Test the method
            foreach (int value in threes)
            {
                Assert.IsTrue(FizzBuzzModel.IsMultipleThree(value));
            }
        }
Beispiel #2
0
        public void TestMultipleThree_Negative()
        {
            // Create a list of integers that are NOT multiples of 3
            List <int> notThrees = new List <int>();

            // Offset by one: 1,4,7,10...
            for (int value = 1; value <= 100; value += 3)
            {
                notThrees.Add(value);
            }
            // Offset by two: 2,5,8,11...
            for (int value = 2; value <= 100; value += 3)
            {
                notThrees.Add(value);
            }

            // Test the method
            foreach (int value in notThrees)
            {
                Assert.IsFalse(FizzBuzzModel.IsMultipleThree(value));
            }
        }