예제 #1
0
        public void HandicapCalculationProcessAggregate_StartHandicapCalculationProcess_AlreadyStarted_ErrorThrown()
        {
            HandicapCalculationProcessAggregate handicapCalculationProcessAggregate = HandicapCalculationProcessTestData.GetStartedHandicapCalculationProcessAggregate();

            Should.Throw <InvalidOperationException>(() =>
            {
                handicapCalculationProcessAggregate.StartHandicapCalculationProcess(TournamentTestData
                                                                                    .GetCompletedTournamentAggregateWithCSSCalculatedAggregate(),
                                                                                    HandicapCalculationProcessTestData
                                                                                    .StartedDateTime);
            });
        }
예제 #2
0
        public void HandicapCalculationProcessAggregate_UpdateProcessToErrored_NotRunning_ErrorThrown()
        {
            HandicapCalculationProcessAggregate handicapCalculationProcessAggregate = HandicapCalculationProcessTestData.GetStartedHandicapCalculationProcessAggregate();

            Should.Throw <InvalidOperationException>(() =>
            {
                handicapCalculationProcessAggregate.UpdateProcessToErrored(HandicapCalculationProcessTestData.ErroredDateTime,
                                                                           HandicapCalculationProcessTestData.ErrorMessage);
            });
        }
예제 #3
0
        public void HandicapCalculationProcessAggregate_UpdateProcessToRunning_ProcessSetToRunning()
        {
            HandicapCalculationProcessAggregate handicapCalculationProcessAggregate = HandicapCalculationProcessTestData.GetStartedHandicapCalculationProcessAggregate();

            handicapCalculationProcessAggregate.UpdateProcessToRunning(HandicapCalculationProcessTestData.RunningDateTime);

            handicapCalculationProcessAggregate.AggregateId.ShouldBe(handicapCalculationProcessAggregate.AggregateId);
            handicapCalculationProcessAggregate.StartedDateTime.ShouldBe(handicapCalculationProcessAggregate.StartedDateTime);
            handicapCalculationProcessAggregate.RunningDateTime.ShouldBe(handicapCalculationProcessAggregate.RunningDateTime);
            handicapCalculationProcessAggregate.Status.ShouldBe(HandicapProcessStatus.Running);
        }