public void FactoryMethodTest_ReturnsNewRobot_RobotTypeShouldBeCyborg() { //Arrange var cyborgCreator = new CyborgCreator(); //Act Robot robotCreated = cyborgCreator.FactoryMethod(); //Assert Assert.IsInstanceOfType(robotCreated, typeof(RobotCyborg)); }
public void GenerateNewGame() { Random rnd = new Random(); int random = rnd.Next(10); if (random < 5) { Robot = new WorkerCreator().Create("workerimage"); } else if (random > 7) { Robot = new ScientistCreator().Create("scientistimage"); } else { Robot = new CyborgCreator().Create("cyborgimage"); } Map = new Map(); GameHistory = new GameHistory(); MoveCounter = 0; }
public void GenerateNewGame() { Random rnd = new Random(); int random = rnd.Next(10); if (random < 5) { Robot = new WorkingCreator().Create(); } else if (random > 7) { Robot = new SmartCreator().Create(); } else { Robot = new CyborgCreator().Create(); } Console.WriteLine("Вам выпал робот: " + Robot.fullHero); //GamePole = new GamePole(); GameHistory = new GameHistory(); pole = new GamePole(this, Robot); }