public NotificationApplicationFactoryTests()
        {
            userContext = A.Fake<IUserContext>();
            numberGenerator = A.Fake<INotificationNumberGenerator>();

            A.CallTo(() => userContext.UserId).Returns(new Guid("246D5402-C835-4448-AFF0-37940B9ED436"));
            A.CallTo(() => numberGenerator.GetNextNotificationNumber(UKCompetentAuthority.England))
                .Returns(6000);

            factory = new NotificationApplicationFactory(userContext, numberGenerator);
        }
예제 #2
0
        public NotificationApplicationFactoryTests()
        {
            userContext     = A.Fake <IUserContext>();
            numberGenerator = A.Fake <INotificationNumberGenerator>();

            A.CallTo(() => userContext.UserId).Returns(new Guid("246D5402-C835-4448-AFF0-37940B9ED436"));
            A.CallTo(() => numberGenerator.GetNextNotificationNumber(UKCompetentAuthority.England))
            .Returns(6000);

            factory = new NotificationApplicationFactory(userContext, numberGenerator);
        }
예제 #3
0
 public CreateLegacyNotificationApplicationHandler(IwsContext context,
                                                   INotificationApplicationRepository notificationApplicationRepository,
                                                   IFacilityRepository facilityRepository,
                                                   ICarrierRepository carrierRepository,
                                                   IProducerRepository producerRepository,
                                                   NotificationApplicationFactory notificationApplicationFactory)
 {
     this.context = context;
     this.notificationApplicationRepository = notificationApplicationRepository;
     this.facilityRepository             = facilityRepository;
     this.carrierRepository              = carrierRepository;
     this.producerRepository             = producerRepository;
     this.notificationApplicationFactory = notificationApplicationFactory;
 }
예제 #4
0
        public RemoveTransitStateForNotificationHandlerTests()
        {
            var userContext = A.Fake <IUserContext>();

            A.CallTo(() => userContext.UserId).Returns(Guid.Empty);
            context = new TestIwsContext(userContext);

            var notification = NotificationApplicationFactory.Create(ExistingNotificationId);
            var transport    = new TransportRoute(ExistingNotificationId);

            transport.AddTransitStateToNotification(TransitStateFactory.Create(ExistingTransitStateId,
                                                                               CountryFactory.Create(new Guid("3E7A0092-B6CB-46AD-ABCC-FB741EB6CF35")), 1));

            context.NotificationApplications.Add(notification);
            context.TransportRoutes.Add(transport);

            var repository = A.Fake <ITransportRouteRepository>();

            A.CallTo(() => repository.GetByNotificationId(ExistingNotificationId)).Returns(transport);

            handler = new RemoveTransitStateForNotificationHandler(context, repository);
        }