예제 #1
0
        public void TestSpiderAdvance()
        {
            SpiderPosition ExpectedFinalPosition = new SpiderPosition(5, 7, "Right");
            string ExpectedFinalString = "5 7 Right";

            WallSpider Spider = new WallSpider(new WallDimensions(7, 15), new SpiderPosition(4, 10, "Left"));
            SpiderPosition NewSpiderPosition = Spider.Advance("FLFLFRFFLF");

            Assert.AreEqual(ExpectedFinalPosition.XPos, NewSpiderPosition.XPos);
            Assert.AreEqual(ExpectedFinalPosition.YPos, NewSpiderPosition.YPos);
            Assert.AreEqual(ExpectedFinalPosition.Dir, NewSpiderPosition.Dir);
            Assert.AreEqual(ExpectedFinalString, NewSpiderPosition.ToString());
        }
예제 #2
0
 public WallSpider(WallDimensions wallDim, SpiderPosition spiderPos)
 {
     SpiderPos = spiderPos;
     SpiderWall = wallDim;
 }