Beispiel #1
0
        public async Task <Guid> HandleAsync(CreateLegacyNotificationApplication message)
        {
            var notification =
                await
                notificationApplicationFactory.CreateLegacy(
                    message.NotificationType,
                    message.CompetentAuthority,
                    message.Number);

            notificationApplicationRepository.Add(notification);

            await context.SaveChangesAsync();

            var facilityCollection = new FacilityCollection(notification.Id);
            var carrierCollection  = new CarrierCollection(notification.Id);
            var producerCollection = new ProducerCollection(notification.Id);

            facilityRepository.Add(facilityCollection);
            carrierRepository.Add(carrierCollection);
            producerRepository.Add(producerCollection);

            await context.SaveChangesAsync();

            return(notification.Id);
        }
Beispiel #2
0
        public async Task CanCreateLegacy()
        {
            var notification = await factory.CreateLegacy(NotificationType.Recovery, UKCompetentAuthority.England, 100);

            Assert.IsType <NotificationApplication>(notification);
        }