Exemplo n.º 1
0
        static void Main()
        {
            var superFizzBuzzGenerator = new SuperFizzBuzzGenerator(new FizzBuzzTokenizer());

            superFizzBuzzGenerator.GenerateClassic();

            Console.WriteLine("Press any key to finish...");
            Console.ReadKey();
        }
        public void CanGenerate_Classic_Should_CallExecute100Times()
        {
            //Arrange
            var mockFizzBuzzTokenizer  = new Mock <IFizzBuzzTokenizer>();
            var superFizzBuzzGenerator = new SuperFizzBuzzGenerator(mockFizzBuzzTokenizer.Object);

            //Act
            superFizzBuzzGenerator.GenerateClassic();

            //Assert
            mockFizzBuzzTokenizer.Verify(sfbg => sfbg.GetToken(It.IsAny <int>()), Times.Exactly(100));
        }
        public void CanGenerate_Classic_Should_StartLimit1_EndLimit100()
        {
            //Arrange
            var startLimit             = 1;
            var endLimit               = 100;
            var superFizzBuzzGenerator = new SuperFizzBuzzGenerator(new FizzBuzzTokenizer());

            //Act
            superFizzBuzzGenerator.GenerateClassic();

            //Assert
            Assert.Equal(startLimit, superFizzBuzzGenerator.StartLimit);
            Assert.Equal(endLimit, superFizzBuzzGenerator.EndLimit);
        }