public void HandicapCalculationProcessStartedEvent_CanBeCreated_IsCreated()
        {
            HandicapCalculationProcessStartedEvent handicapCalculationProcessStartedEvent =
                HandicapCalculationProcessStartedEvent.Create(HandicapCalculationProcessTestData.AggregateId, HandicapCalculationProcessTestData.StartedDateTime);

            handicapCalculationProcessStartedEvent.ShouldNotBeNull();
            handicapCalculationProcessStartedEvent.EventId.ShouldNotBe(Guid.Empty);
            handicapCalculationProcessStartedEvent.EventCreatedDateTime.ShouldNotBe(DateTime.MinValue);
            handicapCalculationProcessStartedEvent.AggregateId.ShouldBe(HandicapCalculationProcessTestData.AggregateId);
            handicapCalculationProcessStartedEvent.StartedDateTime.ShouldBe(HandicapCalculationProcessTestData.StartedDateTime);
        }
        /// <summary>
        /// Starts the handicap calculation process.
        /// </summary>
        /// <param name="tournament">The tournament.</param>
        /// <param name="startedDateTime">The started date time.</param>
        /// <exception cref="InvalidOperationException">All Tournament scores must be published to run a handicap calculation process
        /// or
        /// Tournament must be completed to run a handicap calculation process</exception>
        public void StartHandicapCalculationProcess(TournamentAggregate tournament,
                                                    DateTime startedDateTime)
        {
            // TODO: Business rules to protect reruns etc
            // TODO: handle resuming errored processes

            this.EnsureProcessCanBeStarted();

            if (!tournament.HasBeenCompleted)
            {
                throw new InvalidOperationException("Tournament must be completed to run a handicap calculation process");
            }

            if (!tournament.GetScores().All(s => s.IsPublished))
            {
                throw new InvalidOperationException("All Tournament scores must be published to run a handicap calculation process");
            }

            HandicapCalculationProcessStartedEvent handicapCalculationProcessStartedEvent =
                HandicapCalculationProcessStartedEvent.Create(this.AggregateId, startedDateTime);

            this.ApplyAndPend(handicapCalculationProcessStartedEvent);
        }