public void GetResolution_continues_game_with_remaining_time() { var timeMatchRule = new TimeMatchRule(); var config = new MatchConfig { Stocks = 5, PlayerConfigs = new PlayerConfig[4] }; var state = new MatchState(config) { Time = 100 }; Assert.AreEqual(null, timeMatchRule.GetResolution(state)); }
public void GetResolution_zero_time_results_in_timeout() { var timeMatchRule = new TimeMatchRule(); var config = new MatchConfig { Stocks = 5, PlayerConfigs = new PlayerConfig[4] }; var state = new MatchState(config) { Time = 0 }; Assert.AreEqual(MatchResolution.Tie, timeMatchRule.GetResolution(state)); }
public void Simulate_each_simulate_decreases_remaining_time() { var timeMatchRule = new TimeMatchRule(); var config = new MatchConfig { Stocks = 5, PlayerConfigs = new PlayerConfig[4] }; var state = new MatchState(config) { Time = 100 }; var input = new MatchInput(config); var inputContext = new MatchInputContext(input); Assert.AreEqual(99, timeMatchRule.Simulate(state, inputContext).Time); }