Exemple #1
0
        static void Main(string[] args)
        {
            IReadin         read         = new Readin();
            IParsein        parser       = new Parsein(read);
            IRobotObj       robotobj     = new Robotobj();
            ExecuteCleaning execCleaning = new ExecuteCleaning(read, parser, robotobj);

            execCleaning.Execute();
        }
        public void display_PlacesCleaned()
        {
            ExecuteCleaning order = new ExecuteCleaning(_mockReadin.Object, _mockParsein.Object, _mockRobotObj.Object);

            _mockParsein.Setup(x => x.ReadCommands()).Returns(new ExecuteOrder(new Coord(0, 0), new List <MoveCmd>()));
            _mockRobotObj.Setup(x => x.ExecuteClear(It.IsAny <ExecuteOrder>())).Returns(5420);
            _mockReadin.Setup(x => x.Writeout(It.IsAny <String>()));
            order.Execute();
            _mockReadin.Verify(O => O.Writeout(It.Is <String> (s => s == "=> Cleaned: 5420")), Times.Once);
        }