示例#1
0
        public void Then_Maps_Matching_Fields(ReservationCreatedEvent source)
        {
            ReservationCreatedNotificationEvent result = source;

            result.Should().BeEquivalentTo(source, options =>
                                           options.ExcludingMissingMembers());
        }
示例#2
0
        public async Task Then_Adds_StartDateDescription_To_Tokens(
            ReservationCreatedNotificationEvent createdEvent,
            NotificationTokenBuilder builder)
        {
            var tokens = await builder.BuildTokens(createdEvent);

            tokens[TokenKeyNames.StartDateDescription].Should()
            .Be($"{createdEvent.StartDate:MMM yyyy} to {createdEvent.EndDate:MMM yyyy}");
        }
示例#3
0
        public async Task Then_Adds_ProviderName_To_Tokens(
            ReservationCreatedNotificationEvent createdEvent,
            ProviderDetails provider,
            [Frozen] Mock <IProviderService> mockProviderService,
            NotificationTokenBuilder builder)
        {
            mockProviderService
            .Setup(service => service.GetDetails(createdEvent.ProviderId.Value))
            .ReturnsAsync(provider);

            var tokens = await builder.BuildTokens(createdEvent);

            tokens[TokenKeyNames.ProviderName].Should().Be(provider.Name);
        }