public void Arrange()
        {
            _request = new GetPeriodQueryRequest
            {
                PeriodId = "1617-R02"
            };

            _requestValidator = new Mock <IValidator <GetPeriodQueryRequest> >();
            _requestValidator.Setup(v => v.Validate(It.IsAny <GetPeriodQueryRequest>()))
            .Returns(Task.FromResult(new ValidationResult()));

            _periodRepository = new Mock <IPeriodRepository>();
            _periodRepository.Setup(r => r.GetPeriod("1617-R02"))
            .Returns(Task.FromResult(new PeriodEntity
            {
                Period       = 2,
                AcademicYear = 1617,
                ReferenceDataValidationDate = _expectedDate,
                CompletionDate = _expectedDate
            }));

            _mapper = new AutoMapperMapper(AutoMapperConfigurationFactory.CreateMappingConfig());

            _handler = new Application.Period.GetPeriodQuery.GetPeriodQueryHandler(_requestValidator.Object, _periodRepository.Object, _mapper);
        }
 public void Setup()
 {
     requiredCoInvestedAmount = new CalculatedRequiredCoInvestedAmount
     {
         AmountDue        = 1000.00m,
         CollectionPeriod = CollectionPeriodFactory.CreateFromAcademicYearAndPeriod(1819, 1),
         DeliveryPeriod   = 1,
         EventTime        = DateTime.UtcNow,
         JobId            = 1,
         Learner          = new Learner
         {
             ReferenceNumber = "001",
             Uln             = 1234567890
         },
         OnProgrammeEarningType = OnProgrammeEarningType.Learning,
         LearningAim            = new LearningAim
         {
             FrameworkCode = 403
         },
         PriceEpisodeIdentifier    = "1819-P01",
         SfaContributionPercentage = 0.9m,
         Ukprn        = 10000,
         AccountId    = 1000000,
         ContractType = ContractType.Act2,
         ApprenticeshipEmployerType = ApprenticeshipEmployerType.Levy,
     };
     mapperConfiguration     = AutoMapperConfigurationFactory.CreateMappingConfig();
     autoMapper              = mapperConfiguration.CreateMapper();
     coInvestedFundingMapper = new CoInvestedFundingSourcePaymentEventMapper(autoMapper);
 }
        public void Arrange()
        {
            _request = new GetPeriodsQueryRequest();

            _periodEntity1 = new PeriodEntity
            {
                Period       = 12,
                AcademicYear = 1671,
                ReferenceDataValidationDate = new DateTime(2017, 8, 31),
                CompletionDate = new DateTime(2017, 9, 5, 19, 27, 34)
            };
            _periodEntity2 = new PeriodEntity
            {
                //Id = "1718-R01",
                Period       = 1,
                AcademicYear = 1718,
                ReferenceDataValidationDate = new DateTime(2017, 10, 2),
                CompletionDate = new DateTime(2017, 10, 4, 23, 34, 10)
            };

            _periodRepository = new Mock <IPeriodRepository>();
            _periodRepository.Setup(r => r.GetPeriods())
            .Returns(Task.FromResult(new[] { _periodEntity1, _periodEntity2 }));

            _mapper = new AutoMapperMapper(AutoMapperConfigurationFactory.CreateMappingConfig());

            _handler = new Application.Period.GetPeriodsQuery.GetPeriodsQueryHandler(_periodRepository.Object, _mapper);
        }
Esempio n. 4
0
        public ProgressUpdateTests()
        {
            var autoMapperConfig = new AutoMapperConfigurationFactory().GetNew();

            this.repo = new JobbrRepository(new InMemoryJobStorageProvider());

            this.messengerHub = new TinyMessengerHub();

            this.service = new Server.Core.JobRunService(this.messengerHub, this.repo, null, autoMapperConfig.CreateMapper());
        }
        protected override void Load(ContainerBuilder builder)
        {
            builder.Register(ctx =>
            {
                var config = AutoMapperConfigurationFactory.CreateMappingConfig();
                return(config);
            })
            .SingleInstance() // We only need one instance
            .AutoActivate()   // Create it on ContainerBuilder.Build()
            .AsSelf();        // Bind it to its own type

            builder.Register(tempContext =>
            {
                var ctx    = tempContext.Resolve <IComponentContext>();
                var config = ctx.Resolve <MapperConfiguration>();

                // Create our mapper using our configuration above
                return(config.CreateMapper());
            })
            .As <IMapper>();    // Bind it to the IMapper interface
        }
Esempio n. 6
0
        public void Setup()
        {
            requiredPaymentEvent = new CalculatedRequiredLevyAmount
            {
                AmountDue        = 1000.00m,
                CollectionPeriod = CollectionPeriodFactory.CreateFromAcademicYearAndPeriod(1819, 1),
                DeliveryPeriod   = 1,
                EventTime        = DateTime.UtcNow,
                JobId            = 1,
                Learner          = new Learner
                {
                    ReferenceNumber = "001",
                    Uln             = 1234567890
                },
                OnProgrammeEarningType = OnProgrammeEarningType.Learning,
                LearningAim            = new LearningAim
                {
                    FrameworkCode = 403
                },
                PriceEpisodeIdentifier    = "1819-P01",
                SfaContributionPercentage = 0.9m,
                Ukprn = 10000,

                AgreementId                = "11",
                Priority                   = 13,
                EventId                    = Guid.NewGuid(),
                AccountId                  = 1000000,
                IlrSubmissionDateTime      = DateTime.Today,
                EarningEventId             = Guid.NewGuid(),
                ContractType               = ContractType.Act1,
                ApprenticeshipEmployerType = ApprenticeshipEmployerType.Levy,
                ApprenticeshipId           = 12,
            };
            mapperConfiguration = AutoMapperConfigurationFactory.CreateMappingConfig();
            autoMapper          = mapperConfiguration.CreateMapper();
        }
 public void OneTimeSetUp()
 {
     mapperConfiguration = AutoMapperConfigurationFactory.CreateMappingConfig();
     mapper = mapperConfiguration.CreateMapper();
 }
        public void Setup()
        {
            var requiredPaymentEventEventId = Guid.NewGuid();
            var earningEventId = Guid.NewGuid();
            var utcNow         = DateTime.UtcNow;

            unableToFundTransferFundingSourcePayment = new ProcessUnableToFundTransferFundingSourcePayment
            {
                EventId                = requiredPaymentEventEventId,
                EarningEventId         = earningEventId,
                EventTime              = utcNow,
                RequiredPaymentEventId = requiredPaymentEventEventId,

                AmountDue        = 1000.00m,
                CollectionPeriod = CollectionPeriodFactory.CreateFromAcademicYearAndPeriod(1819, 1),
                DeliveryPeriod   = 1,
                JobId            = 1,
                Learner          = new Learner
                {
                    ReferenceNumber = "001",
                    Uln             = 1234567890
                },
                LearningAim = new LearningAim
                {
                    FrameworkCode = 403
                },
                PriceEpisodeIdentifier    = "1819-P01",
                SfaContributionPercentage = 0.9m,
                Ukprn = 10000,

                AccountId             = 1000000,
                IlrSubmissionDateTime = DateTime.Today,

                ContractType = ContractType.Act1,
                ApprenticeshipEmployerType = ApprenticeshipEmployerType.Levy,
                ApprenticeshipId           = 12,
                CompletionAmount           = 10,
                CompletionStatus           = 1,
                InstalmentAmount           = 10,
                StartDate                    = utcNow,
                TransactionType              = TransactionType.Balancing,
                ActualEndDate                = utcNow,
                FundingSourceType            = FundingSourceType.Levy,
                IlrFileName                  = "Test",
                LearningStartDate            = utcNow,
                NumberOfInstalments          = 1,
                PlannedEndDate               = utcNow,
                ApprenticeshipPriceEpisodeId = 1,
                TransferSenderAccountId      = 10,
                ReportingAimFundingLineType  = "Test"
            };

            expectedEvent = new CalculatedRequiredLevyAmount
            {
                EventId        = requiredPaymentEventEventId,
                EarningEventId = earningEventId,
                EventTime      = utcNow,

                AmountDue        = 1000.00m,
                CollectionPeriod = CollectionPeriodFactory.CreateFromAcademicYearAndPeriod(1819, 1),
                DeliveryPeriod   = 1,
                JobId            = 1,
                Learner          = new Learner
                {
                    ReferenceNumber = "001",
                    Uln             = 1234567890
                },
                LearningAim = new LearningAim
                {
                    FrameworkCode = 403
                },
                PriceEpisodeIdentifier    = "1819-P01",
                SfaContributionPercentage = 0.9m,
                Ukprn = 10000,

                AccountId             = 1000000,
                IlrSubmissionDateTime = DateTime.Today,

                ContractType = ContractType.Act1,
                ApprenticeshipEmployerType = ApprenticeshipEmployerType.Levy,
                ApprenticeshipId           = 12,
                CompletionAmount           = 10,
                CompletionStatus           = 1,
                InstalmentAmount           = 10,
                StartDate                    = utcNow,
                ActualEndDate                = utcNow,
                IlrFileName                  = "Test",
                LearningStartDate            = utcNow,
                NumberOfInstalments          = 1,
                PlannedEndDate               = utcNow,
                ApprenticeshipPriceEpisodeId = 1,
                OnProgrammeEarningType       = OnProgrammeEarningType.Balancing,
                TransferSenderAccountId      = 10,
                ReportingAimFundingLineType  = "Test"
            };

            mapperConfiguration = AutoMapperConfigurationFactory.CreateMappingConfig();
            autoMapper          = mapperConfiguration.CreateMapper();
        }
 public void Setup()
 {
     mapperConfiguration = AutoMapperConfigurationFactory.CreateMappingConfig();
     autoMapper          = mapperConfiguration.CreateMapper();
 }