public void TournamentAggregate_CanBeCreated_IsCreated()
        {
            TournamentAggregate aggregate = TournamentAggregate.Create(TournamentTestData.AggregateId);

            aggregate.ShouldNotBeNull();
            aggregate.AggregateId.ShouldBe(TournamentTestData.AggregateId);
        }
 public void TournamentAggregate_CanBeCreated_EmptyAggregateId_ErrorThrown()
 {
     Should.Throw <ArgumentNullException>(() =>
     {
         TournamentAggregate aggregate = TournamentAggregate.Create(Guid.Empty);
     });
 }
        public static TournamentAggregate GetCreatedTournamentAggregate()
        {
            TournamentAggregate aggregate = TournamentAggregate.Create(TournamentTestData.AggregateId);

            aggregate.CreateTournament(TournamentTestData.TournamentDate, TournamentTestData.GolfClubId, TournamentTestData.MeasuredCourseId, TournamentTestData.MeasuredCourseSSS, TournamentTestData.Name, TournamentTestData.PlayerCategoryEnum, TournamentTestData.TournamentFormatEnum);

            return(aggregate);
        }
        public static TournamentAggregate GetCreatedTournamentWithScoresRecordedAggregate()
        {
            TournamentAggregate aggregate = TournamentAggregate.Create(TournamentTestData.AggregateId);

            aggregate.CreateTournament(TournamentTestData.TournamentDate, TournamentTestData.GolfClubId, TournamentTestData.MeasuredCourseId, TournamentTestData.MeasuredCourseSSS, TournamentTestData.Name, TournamentTestData.PlayerCategoryEnum, TournamentTestData.TournamentFormatEnum);

            aggregate.SignUpForTournament(TournamentTestData.PlayerId);

            aggregate.RecordPlayerScore(TournamentTestData.PlayerId, TournamentTestData.PlayingHandicap, TournamentTestData.HoleScores);

            return(aggregate);
        }
        public static TournamentAggregate GetCompletedTournamentAggregate(Int32 category1Scores = 1, Int32 category2Scores  = 2, Int32 category3Scores = 7,
                                                                          Int32 category4Scores = 20, Int32 category5Scores = 5, Int32 bufferorbetter  = 5)
        {
            TournamentAggregate aggregate = TournamentAggregate.Create(TournamentTestData.AggregateId);

            aggregate.CreateTournament(TournamentTestData.TournamentDate, TournamentTestData.GolfClubId, TournamentTestData.MeasuredCourseId, TournamentTestData.MeasuredCourseSSS, TournamentTestData.Name, TournamentTestData.PlayerCategoryEnum, TournamentTestData.TournamentFormatEnum);

            List <GeneratedPlayerScore> scoresToRecord = TournamentTestData.GenerateScores(category1Scores, category2Scores, category3Scores, category4Scores, category5Scores, bufferorbetter);

            foreach (GeneratedPlayerScore playerScoreForTest in scoresToRecord)
            {
                aggregate.SignUpForTournament(playerScoreForTest.PlayerId);
                aggregate.RecordPlayerScore(playerScoreForTest.PlayerId, playerScoreForTest.Handicap, playerScoreForTest.HoleScores);
            }

            aggregate.CompleteTournament(TournamentTestData.CompletedDateTime);

            return(aggregate);
        }
        public static TournamentAggregate GetEmptyTournamentAggregate()
        {
            TournamentAggregate aggregate = TournamentAggregate.Create(TournamentTestData.AggregateId);

            return(aggregate);
        }