public void GivenNewGame_ThePlayerXIsHumanAndPlayerOIsHuman(string playerXType, string PlayerOType) { var config = new GameConfiguration() { CrossesPlayerType = playerXType, NoughtsPlayerType = PlayerOType }; config.Set(); }
public void ThenPlayerXWinsCoundShouldBe1(int WinsCount) { var configuration = new GameConfiguration(); configuration.UpdateFromCurrentStatus(); Assert.AreEqual(WinsCount, configuration.NoughtsWinsCount); }
public GameConfiguration GetStatus() { GameConfiguration configuration = new GameConfiguration(); if (radioCrossMoveFirst.Checked) { configuration.CrossesMovesFirst = true; } configuration.CrossesPlayerType = lstCrossPlayerMode.SelectedItem; configuration.NoughtsPlayerType = lstNoughtsPlayerMode.SelectedItem; configuration.CrossesWinsCount = Convert.ToInt32(btnCrossWinsCount.Value); configuration.NoughtsWinsCount = Convert.ToInt32(btnNoughtsWinsCount.Value); configuration.DrawsCount = Convert.ToInt32(btnDrawsCount.Value); configuration.CrossesWinsPercent = Convert.ToInt32(btnNoughtsWinsPercent.Value.TrimEnd('%')); configuration.NoughtsWinsPercent = Convert.ToInt32(btnNoughtsWinsPercent.Value.TrimEnd('%')); configuration.DrawsPercent = Convert.ToInt32(btnDrawsPercent.Value.TrimEnd('%')); return configuration; }
public void Set(GameConfiguration gameConfiguration) { if (gameConfiguration.CrossesMovesFirst) { radioCrossMoveFirst.Checked = true; } else { radioNoughtsMoveFirst.Checked = true; } lstCrossPlayerMode.Select(gameConfiguration.CrossesPlayerType); lstNoughtsPlayerMode.Select(gameConfiguration.NoughtsPlayerType); }