public void TestPutPieceNormalOnNonGoalFieldStrategyAction() { //given Strategy strategy = new MyAbstractStrategy(width, height, teamId, goalAreaSize); PutPieceResponse putPieceResponse = new PutPieceResponse() { PutResult = PutResultEnum.NormalOnNonGoalField }; //when strategy.UpdateMap(new Message<PutPieceResponse>(putPieceResponse), position); //then Assert.AreEqual(Agent.Board.GoalInfo.DiscoveredNotGoal, strategy.Board.Board[position.X, position.Y].goalInfo); }
public void TestPutPieceSetsHasPieceToFalse() { //given var strategy = new Mock <IStrategy>(); AgentInfo agentInfo = new AgentInfo(strategy.Object, defaultGameStartedMessage); PutPieceResponse putPiece = new PutPieceResponse(); PickPieceResponse pickPiece = new PickPieceResponse(); //when Message pickUp = new Message <PickPieceResponse>(pickPiece); agentInfo.UpdateFromMessage(pickUp); Message checkUp = new Message <PutPieceResponse>(putPiece); agentInfo.UpdateFromMessage(checkUp); //then Assert.AreEqual(false, agentInfo.HasPiece); }
virtual protected void PutPieceResponseHandler(PutPieceResponse putPieceRespone, Point position) { switch (putPieceRespone.PutResult) { case PutResultEnum.NormalOnGoalField: Board.Board[position.X, position.Y].goalInfo = GoalInfo.DiscoveredGoal; break; case PutResultEnum.NormalOnNonGoalField: Board.Board[position.X, position.Y].goalInfo = GoalInfo.DiscoveredNotGoal; break; case PutResultEnum.TaskField: case PutResultEnum.ShamOnGoalArea: //TaskField- odłożynie na pole które nie jeste goalem (środek planszy) //ShamOnGoalArea-nie wiemy czy pole pod było prawdzym goalem czy nie break; } }