public void IdentifyNumberType_ValidNoMatch_ReturnsType()
        {
            // arrange
            var numberIdentifier = new NumberIdentifier();

            // act
            var type = numberIdentifier.IdentifyNumberType(0);

            // assert
            Assert.AreEqual(CriteriaType.None, type);
        }
        public void IdentifyNumberType_ValidFizz_ReturnsType()
        {
            // arrange
            var numberIdentifier = new NumberIdentifier();

            // act
            var type = numberIdentifier.IdentifyNumberType(3);

            // assert
            Assert.AreEqual(CriteriaType.Fizz, type);
        }
Beispiel #3
0
        static void Main(string[] args)
        {
            // 1.) Initialize our number identifier
            var numberIdentifier = new NumberIdentifier();

            // 2.) Iterate through all the numbers in a given range.
            for (int i = 1; i <= 100; i++)
            {
                // 3.) Using the LogNumber extension method to output to the console app and
                // calling our number identifier to resolve the type: Fizz, Buzz, FizzBuzz or None.
                i.LogNumber(numberIdentifier.IdentifyNumberType(i));

                Console.ReadKey();
            }
        }