public void Write()
        {
            Console.WriteLine("Please enter a number");
            var inputString = Console.ReadLine();

            Console.WriteLine(_consoleOutput.GetConsoleOutput(inputString));
            Console.Read();
        }
Exemplo n.º 2
0
        public void GetConsoleOutput_ValidNumber_ReturnsFizzBuzzNumber()
        {
            // Assign
            this._mockCalculator.Stub(c => c.FizzBuzz(5)).Return("buzz");
            this._mockConsoleOutput = new ConsoleOutput(_mockCalculator);

            // Act
            var output = _mockConsoleOutput.GetConsoleOutput("5");

            // Assert
            Assert.AreEqual(output, "buzz");
        }
Exemplo n.º 3
0
        public void GetConsoleOutput_NotANumberReturnsFizzBuzzNumber()
        {
            // Assign
            // this._mockICalculator.Stub(c => c.FizzBuzz(Arg<int>.Is.Anything)).Return("buzz");
            this._mockCalculator.Stub(c => c.FizzBuzz(5)).Return("buzz");

            this._mockConsoleOutput = new ConsoleOutput(_mockCalculator);

            // Act
            var output = _mockConsoleOutput.GetConsoleOutput("hello");

            // Assert
            Assert.AreEqual(output, "Please enter a valid number");
        }