Exemple #1
0
        public void ShouldGoodByeOnStop()
        {
            OcheTestHelper.SetUpInputBuffer();
            OcheTestHelper.SetUpOutputBuffer();
            var oche = new Oche(OcheTestHelper.GetStartAndStopInputReader(), OcheTestHelper.GetCumulativeOutputWriter());

            oche.NextInput();
            oche.IsStartInput().Should().BeTrue();

            oche.NextInput();
            oche.IsStopInput().Should().BeTrue();
            OcheTestHelper.OutputBuffer[1].Should().Be("Adios Gabriel");
        }
Exemple #2
0
        public void ShouldSaluteOnStart()
        {
            OcheTestHelper.SetUpInputBuffer();
            OcheTestHelper.SetUpOutputBuffer();
            var oche = new Oche(OcheTestHelper.GetStartInputReader(), OcheTestHelper.GetCumulativeOutputWriter());

            oche.NextInput();

            Assert.Equal(true, oche.IsStartInput());
            OcheTestHelper.OutputBuffer[0].Should().Be("Hola Gabriel");
        }
Exemple #3
0
        public void ShouldReverseSingleInput()
        {
            OcheTestHelper.SetUpInputBuffer();
            OcheTestHelper.SetUpOutputBuffer();
            var oche = new Oche(OcheTestHelper.GetDogInputReader(), OcheTestHelper.GetCumulativeOutputWriter());

            oche.NextInput();
            oche.Reverse();

            OcheTestHelper.OutputBuffer.Should().HaveCount(1);
            OcheTestHelper.OutputBuffer[0].Should().Be("orrep");
        }
Exemple #4
0
        public void ShouldBeGladWithPalindrome()
        {
            OcheTestHelper.SetUpInputBuffer();
            OcheTestHelper.SetUpOutputBuffer();
            var oche = new Oche(OcheTestHelper.GetPalindromeInputReader(), OcheTestHelper.GetCumulativeOutputWriter());

            oche.NextInput();
            oche.Reverse();

            OcheTestHelper.OutputBuffer.Should().HaveCount(2);
            OcheTestHelper.OutputBuffer[0].Should().Be("oso");
            OcheTestHelper.OutputBuffer[1].Should().Be("Bonita palabra!");
        }