public void PlayerScorePublishedEvent_CanBeCreated_IsCreated()
        {
            PlayerScorePublishedEvent playerScorePublishedEvent = PlayerScorePublishedEvent.Create(TournamentTestData.AggregateId,
                                                                                                   TournamentTestData.PlayerId,
                                                                                                   TournamentTestData.PlayingHandicap,
                                                                                                   TournamentTestData.HoleScores,
                                                                                                   TournamentTestData.GolfClubId,
                                                                                                   TournamentTestData.MeasuredCourseId,
                                                                                                   TournamentTestData.GrossScore,
                                                                                                   TournamentTestData.NetScore,
                                                                                                   TournamentTestData.CSS);

            playerScorePublishedEvent.ShouldNotBeNull();
            playerScorePublishedEvent.AggregateId.ShouldBe(TournamentTestData.AggregateId);
            playerScorePublishedEvent.PlayerId.ShouldBe(TournamentTestData.PlayerId);
            playerScorePublishedEvent.PlayingHandicap.ShouldBe(TournamentTestData.PlayingHandicap);
            playerScorePublishedEvent.HoleScores.ShouldBe(TournamentTestData.HoleScores);
            playerScorePublishedEvent.GolfClubId.ShouldBe(TournamentTestData.GolfClubId);
            playerScorePublishedEvent.MeasuredCourseId.ShouldBe(TournamentTestData.MeasuredCourseId);
            playerScorePublishedEvent.GrossScore.ShouldBe(TournamentTestData.GrossScore);
            playerScorePublishedEvent.NetScore.ShouldBe(TournamentTestData.NetScore);
            playerScorePublishedEvent.CSS.ShouldBe(TournamentTestData.CSS);
            playerScorePublishedEvent.EventCreatedDateTime.ShouldNotBe(DateTime.MinValue);
            playerScorePublishedEvent.EventId.ShouldNotBe(Guid.Empty);
        }
 public static PlayerScorePublishedEvent GetPlayerScorePublishedEvent()
 {
     return(PlayerScorePublishedEvent.Create(TournamentTestData.AggregateId,
                                             TournamentTestData.PlayerId,
                                             TournamentTestData.PlayingHandicap,
                                             TournamentTestData.HoleScores,
                                             TournamentTestData.GolfClubId,
                                             TournamentTestData.MeasuredCourseId,
                                             TournamentTestData.GrossScore,
                                             TournamentTestData.NetScore,
                                             TournamentTestData.CSS));
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Handles the specific event.
 /// </summary>
 /// <param name="domainEvent">The domain event.</param>
 /// <param name="cancellationToken">The cancellation token.</param>
 /// <returns></returns>
 /// <exception cref="NotImplementedException"></exception>
 private async Task HandleSpecificDomainEvent(PlayerScorePublishedEvent domainEvent,
                                              CancellationToken cancellationToken)
 {
     await this.Manager.InsertPlayerScoreToReadModel(domainEvent, cancellationToken);
 }