示例#1
0
    protected static void SetupMatchResultsForTeam(string name)
    {
      var leaderboard = new Leaderboard();
      var matchResults = new[] { MatchResult.WinnerAndLoser(name, Guid.NewGuid().ToString(), "Win") };
      leaderboard.Include(matchResults);

      leaderboardRepository = MockRepository.GenerateMock<ILeaderboardRepository>();
      leaderboardRepository.Stub(x => x.GetLeaderboard()).Return(leaderboard);
    }
        public Leaderboard GetLeaderboard()
        {
            var value = _repository.FindById(Guid.Empty);
              if (value == null)
              {
            value = new Leaderboard();
            _repository.Add(value);
              }

              return value;
        }
 public void SetLeaderboard(Leaderboard leaderboard)
 {
     _repository.Update(leaderboard);
 }