Source

RockPaperScissors / RockPaperScissors / SingleRoundStrategy.cs

Full commit
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace RockPaperScissors
{
  public class SingleRoundStrategy : IShouldPlayAgain, IKnowWhoWon
  {
    public bool ShouldPlayAgain( List<Player> gameResults )
    {
      if ( gameResults == null ) return true;
      else if ( gameResults.Count != 1 ) return true;
      else return false;
    }

    public Player GetWhoWon( List<Player> gameResults )
    {
      if ( gameResults == null || gameResults.Count == 0 )
        throw new InvalidOperationException( "Must have gameResults" );

      return gameResults[0];
    }
  }
}