public void TestUnitOrderWaitAfterMove() { session.StartTurn(session.PlayerTeam); //select Hector session.OnConfirmationInputReceived(20, 13); //move one square to the right session.OnPositionHover(21, 13); //select the square to move him there. session.OnConfirmationInputReceived(21, 13); //select "Wait" UnitWaitAction waitCommand = session.OnConfirmationInputReceived(MenuTypes.Unit, "Wait")[1] as UnitWaitAction; Assert.IsNotNull(waitCommand, "Wait did not occur"); //refresh Hector session.StartTurn(session.PlayerTeam); //select Hector UnitSelectedAction hectorEntity = session.OnConfirmationInputReceived(21, 13)[0] as UnitSelectedAction; Assert.IsNotNull(hectorEntity, "Did not select Hector"); }
public void TestUnitMovePathingPathBacktrack() { session.StartTurn(session.PlayerTeam); //select Hector session.OnConfirmationInputReceived(20, 13); //move one square to the right session.OnPositionHover(21, 13); //move one square to the right session.OnPositionHover(22, 13); //move one square to the left session.OnPositionHover(21, 13); //select the square to move him there. session.OnConfirmationInputReceived(21, 13); //select "Wait". Action 0 is the move action to move 1 space UnitWaitAction waitCommand = session.OnConfirmationInputReceived(MenuTypes.Unit, "Wait")[1] as UnitWaitAction; Assert.IsNotNull(waitCommand, "Action [1] wasn't the wait command"); //refresh Hector session.StartTurn(session.PlayerTeam); //select Hector UnitSelectedAction hectorEntity = session.OnConfirmationInputReceived(21, 13)[0] as UnitSelectedAction; Assert.IsNotNull(hectorEntity, "Did not select Hector"); //move three squares to the right session.OnPositionHover(22, 13); session.OnPositionHover(23, 13); session.OnPositionHover(24, 13); //move one square to the down session.OnPositionHover(24, 12); //move two squares to the left session.OnPositionHover(23, 12); session.OnPositionHover(22, 12); //select the square to move him there. session.OnConfirmationInputReceived(22, 12); //select "Wait". Action 0 & 1 are moves now. waitCommand = session.OnConfirmationInputReceived(MenuTypes.Unit, "Wait")[2] as UnitWaitAction; Assert.IsNotNull(waitCommand, "Action [2] wasn't the wait command, 2nd time"); //refresh Hector session.StartTurn(session.PlayerTeam); //select Hector hectorEntity = session.OnConfirmationInputReceived(22, 12)[0] as UnitSelectedAction; Assert.IsNotNull(hectorEntity, "Did not select Hector"); }
public void TestUnitOrderWaitInPlace() { session.StartTurn(session.PlayerTeam); //select Hector UnitSelectedAction hectorEntity = session.OnConfirmationInputReceived(20, 13)[0] as UnitSelectedAction; Assert.IsNotNull(hectorEntity, "Did not select Hector"); //re-select Hector's square to "move" him there. MenuOpenedAction unitOptions = session.OnConfirmationInputReceived(20, 13)[0] as MenuOpenedAction; Assert.IsNotNull(unitOptions, "Did not get the unit menu as expected"); Assert.AreEqual(unitOptions.OpenedMenu.MenuType, MenuTypes.Unit, "Did not get a unit menu"); Assert.IsTrue(unitOptions.OpenedMenu.Actions.Contains("Wait"), "Did not have Wait as expected"); //select "Wait" UnitWaitAction waitCommand = session.OnConfirmationInputReceived(MenuTypes.Unit, "Wait")[0] as UnitWaitAction; Assert.IsNotNull(waitCommand); }