public string ScoreAgainstAnother(ScoreArray opponent) { for (int index = 0; index < _scores.Count; index++) { _myScore += opponent.EvaluateAgainstOpponent(_scores[index], index); } return(opponent.AppendScore($"{_myScore} ")); }
public void ShouldScoreOpponenteOnForMyWin() { ScoreArray score = new ScoreArray(new List <int> { 3 }); int actual = score.EvaluateAgainstOpponent(5, 0); actual.Should().Be(1); }
public void ShouldScoreOpponentZeroForOpponentWin() { ScoreArray score = new ScoreArray(new List <int> { 5 }); int actual = score.EvaluateAgainstOpponent(3, 0); actual.Should().Be(0); }
public void ShouldAppendScore() { // arrange ScoreArray scoreArray = new ScoreArray(new List <int>()); // act string actual = scoreArray.AppendScore(""); // assert actual.Should().Be("0"); }
public void ShouldScoreArrayNonZeroTie() { ScoreArray scoreA = new ScoreArray(new List <int> { 6, 6, 6 }); ScoreArray scoreB = new ScoreArray(new List <int> { 3, 6, 10 }); string actual = scoreA.ScoreAgainstAnother(scoreB); actual.Should().Be("1 1"); }
public void ShouldScoreArrayOtherWinnerWith2() { ScoreArray scoreA = new ScoreArray(new List <int> { 24, 1, 0 }); ScoreArray scoreB = new ScoreArray(new List <int> { 3, 4, 5 }); string actual = scoreA.ScoreAgainstAnother(scoreB); actual.Should().Be("1 2"); }
public void ShouldScoreArraySelfWinner() { ScoreArray scoreA = new ScoreArray(new List <int> { 6, 6, 6 }); ScoreArray scoreB = new ScoreArray(new List <int> { 3, 4, 5 }); string actual = scoreA.ScoreAgainstAnother(scoreB); actual.Should().Be("3 0"); }