Esempio n. 1
0
        public GetWasteCodeLookupAndNotificationDataByTypesHandlerTests()
        {
            wasteCodeRepository = A.Fake <IWasteCodeRepository>();
            notificationApplicationRepository = A.Fake <INotificationApplicationRepository>();
            //var context = new TestIwsContext();

            handler = new GetWasteCodeLookupAndNotificationDataByTypesHandler(notificationApplicationRepository, wasteCodeRepository, new WasteCodeMap(), new WasteCodeMap());

            A.CallTo(() => wasteCodeRepository.GetAllWasteCodes()).Returns(wasteCodes);

            var notificationWithWasteCodes = new TestableNotificationApplication
            {
                Id         = NotificationWithWasteCodesId,
                WasteCodes = new WasteCodeInfo[]
                {
                    new TestableWasteCodeInfo(FirstBaselCode)
                }
            };

            A.CallTo(() => notificationApplicationRepository.GetById(NotificationWithWasteCodesId)).Returns(notificationWithWasteCodes);

            var notificationWithoutWasteCodes = new TestableNotificationApplication
            {
                Id = NotificationWithoutWasteCodesId
            };

            A.CallTo(() => notificationApplicationRepository.GetById(NotificationWithoutWasteCodesId)).Returns(notificationWithoutWasteCodes);
        }
        public GetWasteRecoveryProviderHandlerTests()
        {
            notification = new TestableNotificationApplication { Id = NotificationId };
            repository = A.Fake<INotificationApplicationRepository>();
            A.CallTo(() => repository.GetById(NotificationId)).Returns(notification);

            handler = new GetWasteRecoveryProviderHandler(repository);
        }
        public WasteCodesViewModelTests()
        {
            notification = new TestableNotificationApplication
            {
                WasteCodes = wasteCodes
            };

            viewModel = FormatterServices.GetUninitializedObject(typeof(TestableWasteCodesViewModel)) as TestableWasteCodesViewModel;
        }
Esempio n. 4
0
        public WasteCodesViewModelTests()
        {
            notification = new TestableNotificationApplication
            {
                WasteCodes = wasteCodes
            };

            viewModel = FormatterServices.GetUninitializedObject(typeof(TestableWasteCodesViewModel)) as TestableWasteCodesViewModel;
        }
Esempio n. 5
0
        public GetWasteRecoveryProviderHandlerTests()
        {
            notification = new TestableNotificationApplication {
                Id = NotificationId
            };
            repository = A.Fake <INotificationApplicationRepository>();
            A.CallTo(() => repository.GetById(NotificationId)).Returns(notification);

            handler = new GetWasteRecoveryProviderHandler(repository);
        }
        public SetWasteRecoveryProviderHandlerTests()
        {
            context    = new TestIwsContext();
            repository = A.Fake <INotificationApplicationRepository>();

            var notification = new TestableNotificationApplication
            {
                Id = NotificationId
            };

            context.NotificationApplications.Add(notification);
            A.CallTo(() => repository.GetById(NotificationId)).Returns(notification);

            handler = new SetWasteRecoveryProviderHandler(repository, context);
        }
Esempio n. 7
0
        public NotificationChargeCalculatorTests()
        {
            notificationId = new Guid("C4C62654-048C-45A2-BF7F-9837EFCF328F");

            shipmentInfoRepository             = A.Fake <IShipmentInfoRepository>();
            shipmentInfo                       = A.Fake <ShipmentInfo>();
            notificationApplicationRepository  = A.Fake <INotificationApplicationRepository>();
            pricingStructureRepository         = A.Fake <IPricingStructureRepository>();
            facilityRepository                 = A.Fake <IFacilityRepository>();
            numberOfShipmentsHistotyRepository = A.Fake <INumberOfShipmentsHistotyRepository>();

            notificationApplication = new TestableNotificationApplication();

            chargeCalculator = new NotificationChargeCalculator(shipmentInfoRepository, notificationApplicationRepository, pricingStructureRepository, facilityRepository, numberOfShipmentsHistotyRepository);
        }
        public NotificationChargeCalculatorTests()
        {
            notificationId = new Guid("C4C62654-048C-45A2-BF7F-9837EFCF328F");

            shipmentInfoRepository = A.Fake<IShipmentInfoRepository>();
            shipmentInfo = A.Fake<ShipmentInfo>();
            notificationApplicationRepository = A.Fake<INotificationApplicationRepository>();
            pricingStructureRepository = A.Fake<IPricingStructureRepository>();
            facilityRepository = A.Fake<IFacilityRepository>();
            numberOfShipmentsHistotyRepository = A.Fake<INumberOfShipmentsHistotyRepository>();

            notificationApplication = new TestableNotificationApplication();

            chargeCalculator = new NotificationChargeCalculator(shipmentInfoRepository, notificationApplicationRepository, pricingStructureRepository, facilityRepository, numberOfShipmentsHistotyRepository);
        }
        public SetWasteRecoveryProviderHandlerTests()
        {
            context = new TestIwsContext();
            repository = A.Fake<INotificationApplicationRepository>();

            var notification = new TestableNotificationApplication
            {
                Id = NotificationId
            };

            context.NotificationApplications.Add(notification);
            A.CallTo(() => repository.GetById(NotificationId)).Returns(notification);

            handler = new SetWasteRecoveryProviderHandler(repository, context);
        }
        public RequiredAnnexesTests()
        {
            var notificationApplicationRepository = A.Fake<INotificationApplicationRepository>();
            technologyEmployedRepository = A.Fake<ITechnologyEmployedRepository>();

            notification = new TestableNotificationApplication();
            notification.Id = notificationId;
            technologyEmployed = TechnologyEmployed.CreateTechnologyEmployedWithFurtherDetails(notificationId, "details", "further details");

            A.CallTo(() => notificationApplicationRepository.GetById(notificationId)).Returns(notification);

            A.CallTo(() => technologyEmployedRepository.GetByNotificaitonId(notificationId))
                .Returns(technologyEmployed);

            requiredAnnexes = new RequiredAnnexes(notificationApplicationRepository, technologyEmployedRepository);
        }
Esempio n. 11
0
        public RequiredAnnexesTests()
        {
            var notificationApplicationRepository = A.Fake <INotificationApplicationRepository>();

            technologyEmployedRepository = A.Fake <ITechnologyEmployedRepository>();

            notification       = new TestableNotificationApplication();
            notification.Id    = notificationId;
            technologyEmployed = TechnologyEmployed.CreateTechnologyEmployedWithFurtherDetails(notificationId, "details", "further details");

            A.CallTo(() => notificationApplicationRepository.GetById(notificationId)).Returns(notification);

            A.CallTo(() => technologyEmployedRepository.GetByNotificaitonId(notificationId))
            .Returns(technologyEmployed);

            requiredAnnexes = new RequiredAnnexes(notificationApplicationRepository, technologyEmployedRepository);
        }
 public MovementViewModelTests()
 {
     notification = new TestableNotificationApplication
     {
         Id = new Guid("07FF7B1D-A3A9-4FB1-B10B-F00EEF8FB9F8")
     };
     movement = new TestableMovement
     {
         Id = new Guid("B20B7BBE-EA7C-45F7-B6DB-04F645E7375B")
     };
     movementDetails = new TestableMovementDetails
     {
         Id = new Guid("E5DF0706-F17C-49CC-8DB2-B6A524A4C372")
     };
     shipmentInfo = new TestableShipmentInfo
     {
         Id = new Guid("B2B2ADE7-34EF-468D-BB88-72D8B5394AE6")
     };
 }
Esempio n. 13
0
 public MovementViewModelTests()
 {
     notification = new TestableNotificationApplication
     {
         Id = new Guid("07FF7B1D-A3A9-4FB1-B10B-F00EEF8FB9F8"),
         CompetentAuthority = UKCompetentAuthority.England
     };
     movement = new TestableMovement
     {
         Id = new Guid("B20B7BBE-EA7C-45F7-B6DB-04F645E7375B")
     };
     movementDetails = new TestableMovementDetails
     {
         Id = new Guid("E5DF0706-F17C-49CC-8DB2-B6A524A4C372")
     };
     shipmentInfo = new TestableShipmentInfo
     {
         Id = new Guid("B2B2ADE7-34EF-468D-BB88-72D8B5394AE6")
     };
 }
        public OperationViewModelTests()
        {
            operationInfos = new List<OperationInfo>
            {
                new TestableOperationInfo { OperationCode = OperationCode.D1 }
            };

            technologyEmployed = new TestableTechnologyEmployed
            {
                AnnexProvided = true,
                Details = "Do stuff",
                FurtherDetails = "Do more stuff"
            };

            notification = new TestableNotificationApplication
            {
                ReasonForExport = "Washing",
                OperationInfos = operationInfos
            };
        }
Esempio n. 15
0
        public OperationViewModelTests()
        {
            operationInfos = new List <OperationInfo>
            {
                new TestableOperationInfo {
                    OperationCode = OperationCode.D1
                }
            };

            technologyEmployed = new TestableTechnologyEmployed
            {
                AnnexProvided  = true,
                Details        = "Do stuff",
                FurtherDetails = "Do more stuff"
            };

            notification = new TestableNotificationApplication
            {
                ReasonForExport = "Washing",
                OperationInfos  = operationInfos
            };
        }
Esempio n. 16
0
        protected TestBase()
        {
            UserContext = new TestUserContext(UserId);
            Context     = new TestIwsContext(UserContext);

            NotificationApplication = new TestableNotificationApplication
            {
                Id     = NotificationId,
                UserId = UserId
            };

            Context.Countries.AddRange(new[]
            {
                TestableCountry.France,
                TestableCountry.Switzerland,
                TestableCountry.UnitedKingdom
            });

            Movement = new TestableMovement
            {
                Id             = MovementId,
                NotificationId = NotificationId
            };
        }