Beispiel #1
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");
        }
Beispiel #2
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");
        }
Beispiel #3
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!");
        }
Beispiel #4
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");
        }