Ejemplo n.º 1
0
        public void GetLastPosition()
        {
            Rover rover = new Rover("1 2 N");

            rover.ChangePosition("LMLMLMLMM");

            //expexted position
            Position position = new Position
            {
                XPoint    = 1,
                YPoint    = 3,
                Direction = MarsRovers.Enum.Directions.N
            };

            Assert.AreEqual(JsonConvert.SerializeObject(position), JsonConvert.SerializeObject(rover.GetCurrentPosition()));
        }
Ejemplo n.º 2
0
        public void GetLastPositionFalsePositive()
        {
            Rover rover = new Rover("1 2 N");

            rover.ChangePosition("LMLMLMLMMM");

            //expexted position
            //Position position = new Position
            //{
            //    XPoint = 2,
            //    YPoint = 3,
            //    Direction = Hepsiburada_Case.Enum.Directions.N
            //};

            //non expexted position
            Position position = new Position
            {
                XPoint    = 1,
                YPoint    = 3,
                Direction = MarsRovers.Enum.Directions.N
            };

            Assert.AreNotEqual(JsonConvert.SerializeObject(position), JsonConvert.SerializeObject(rover.GetCurrentPosition()));
        }