コード例 #1
0
ファイル: CintRobotTest.cs プロジェクト: payam49er/Robot
        public void Cleaned_Spots_NoMove_Count()
        {
            int commandCount = 2;

            int[] initialCoordinate = new[] { 0, 0 };
            List <Tuple <string, int> > directions = new List <Tuple <string, int> >
            {
                new Tuple <string, int>("E", 0),
                new Tuple <string, int>("W", 0)
            };

            Robot robot        = new Robot(commandCount, initialCoordinate, directions);
            int   cleanedSpots = robot.GetCleanedCount();

            Assert.AreEqual(1, cleanedSpots);
        }
コード例 #2
0
ファイル: CintRobotTest.cs プロジェクト: payam49er/Robot
        public void Cleaned_Spots_OnYAxis_Count()
        {
            int commandCount = 3;

            int[] initialCoordinate = new[] { 0, 0 };
            List <Tuple <string, int> > directions = new List <Tuple <string, int> >
            {
                new Tuple <string, int>("N", 5),
                new Tuple <string, int>("S", 10),
                new Tuple <string, int>("N", 5)
            };

            Robot robot        = new Robot(commandCount, initialCoordinate, directions);
            int   cleanedSpots = robot.GetCleanedCount();

            Assert.AreEqual(11, cleanedSpots);
        }