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()); }
public WallSpider(WallDimensions wallDim, SpiderPosition spiderPos) { SpiderPos = spiderPos; SpiderWall = wallDim; }