public void Then_the_incentive_phase_is_initialised_when_created(Phase phase)
        {
            // Act
            var newIncentivePhase = new IncentivePhase(phase);

            // Assert
            newIncentivePhase.Identifier.Should().Be(phase);
        }
        public void Then_the_current_incentive_phase_is_created_by_the_factory_method()
        {
            // Arrange
            var expectedPhase = new IncentivePhase(Phase.Phase2);

            // Act
            var result = IncentivePhase.Create();

            // Assert
            result.Should().BeEquivalentTo(expectedPhase);
        }
        public void Then_the_phase_is_set(Phase phase)
        {
            // Arrange
            var incentivePhase = new IncentivePhase(phase);

            // Act
            var incentive = new ApprenticeshipIncentiveFactory().CreateNew(_fixture.Create <Guid>(), _fixture.Create <Guid>(), _fixture.Create <ApprenticeshipIncentives.ValueTypes.Account>(), _fixture.Create <ApprenticeshipIncentives.ValueTypes.Apprenticeship>(), _fixture.Create <DateTime>(), _fixture.Create <DateTime>(), _fixture.Create <string>(), new AgreementVersion(_fixture.Create <int>()), incentivePhase);

            // Assert
            incentive.GetModel().Phase.Identifier.Should().Be(phase);
        }
        public void Submit(DateTime submittedAt, string submittedByEmail, string submittedByName)
        {
            Model.Status           = IncentiveApplicationStatus.Submitted;
            Model.DateSubmitted    = submittedAt;
            Model.SubmittedByEmail = submittedByEmail;
            Model.SubmittedByName  = submittedByName;

            Model.ApprenticeshipModels.ToList().ForEach(m => m.Phase = IncentivePhase.Create().Identifier);

            Model.ApprenticeshipModels = FilterEligibleApprenticeships(Model.ApprenticeshipModels);

            AddEvent(new Submitted(Model));
        }
Exemplo n.º 5
0
 public ApprenticeshipIncentiveBuilder WithIncentivePhase(IncentivePhase incentivePhase)
 {
     _apprenticeshipIncentiveModel.Phase = incentivePhase;
     return(this);
 }
 internal static ApprenticeshipIncentive New(Guid id, Guid applicationApprenticeshipId, Account account, Apprenticeship apprenticeship, DateTime plannedStartDate, DateTime submittedDate, string submittedByEmail, AgreementVersion agreementVersion, IncentivePhase phase)
 {
     return(new ApprenticeshipIncentive(
                id,
                new ApprenticeshipIncentiveModel
     {
         Id = id,
         ApplicationApprenticeshipId = applicationApprenticeshipId,
         Account = account,
         Apprenticeship = apprenticeship,
         StartDate = plannedStartDate,
         PausePayments = false,
         SubmittedDate = submittedDate,
         SubmittedByEmail = submittedByEmail,
         Status = IncentiveStatus.Active,
         MinimumAgreementVersion = agreementVersion,
         Phase = phase
     }, true));
 }
 public ApprenticeshipIncentive CreateNew(Guid id, Guid applicationApprenticeshipId, Account account, Apprenticeship apprenticeship, DateTime plannedStartDate, DateTime submittedDate, string submittedByEmail, AgreementVersion agreementVersion, IncentivePhase phase)
 {
     return(ApprenticeshipIncentive.New(id, applicationApprenticeshipId, account, apprenticeship, plannedStartDate, submittedDate, submittedByEmail, agreementVersion, phase));
 }