Exemplo n.º 1
0
        public void ExecuteOneStep()
        {
            var sut = new SeaCucumberHerd(@"..........
.>v....v..
.......>..
..........");

            sut.Step(1);
            Assert.Equal(@"..........
.>........
..v....v>.
..........", sut.ToString());
        }
Exemplo n.º 2
0
        public void MoveCucumbersFiftyEightSteps_WhenUsingSampleMap()
        {
            var sut = new SeaCucumberHerd(SAMPLE_SEAFLOOR);

            sut.Step(58);
            Assert.Equal(@"..>>v>vv..
..v.>>vv..
..>>v>>vv.
..>>>>>vv.
v......>vv
v>v....>>v
vvv.....>>
>vv......>
.>v.vv.v..", sut.ToString());
        }
Exemplo n.º 3
0
        public void MoveCucumbersThreeStep_WhenUsingSampleMap()
        {
            var sut = new SeaCucumberHerd(SAMPLE_SEAFLOOR);

            sut.Step(3);
            Assert.Equal(@"v>v.v>.>v.
v...>>.v.v
>vv>.>v>..
>>v>v.>.v>
..>....v..
.>.>v>v..v
..v..v>vv>
v.v..>>v..
.v>....v..", sut.ToString());
        }
Exemplo n.º 4
0
        public void MoveCucumbersFortySteps_WhenUsingSampleMap()
        {
            var sut = new SeaCucumberHerd(SAMPLE_SEAFLOOR);

            sut.Step(40);
            Assert.Equal(@">>v>v..v..
..>>v..vv.
..>>>v.>.v
..>>>>vvv>
v.....>...
v.v...>v>>
>vv.....v>
.>v...v.>v
vvv.v..v.>", sut.ToString());
        }
Exemplo n.º 5
0
        public void MoveCucumbersFourStepsToTheOtherSideOfMap_WhenReachingAborder()
        {
            var sut = new SeaCucumberHerd(@"...>...
.......
......>
v.....>
......>
.......
..vvv..");

            sut.Step(4);
            Assert.Equal(@">......
..v....
..>.v..
.>.v...
...>...
.......
v......", sut.ToString());
        }