public WhenCohortIsCreatedTestFixture() { UnitOfWorkContext = new UnitOfWorkContext(); ReservationId = _autoFixture.Create <Guid>(); UserInfo = _autoFixture.Create <UserInfo>(); var cohort = new CommitmentsV2.Models.Cohort(); cohort.SetValue(x => x.ProviderId, _autoFixture.Create <long>()); ContinuedApprenticeship = new CommitmentsV2.Models.Apprenticeship(); ContinuedApprenticeship.SetValue(x => x.Id, _autoFixture.Create <long>()); ContinuedApprenticeship.SetValue(x => x.Cohort, cohort); ContinuedApprenticeship.SetValue(x => x.CommitmentId, cohort.Id); ContinuedApprenticeship.SetValue(x => x.FirstName, _autoFixture.Create <string>()); ContinuedApprenticeship.SetValue(x => x.LastName, _autoFixture.Create <string>()); ContinuedApprenticeship.SetValue(x => x.DateOfBirth, _autoFixture.Create <DateTime>()); ContinuedApprenticeship.SetValue(x => x.Uln, _autoFixture.Create <string>()); ContinuedApprenticeship.SetValue(x => x.StartDate, _autoFixture.Create <DateTime?>()); ContinuedApprenticeship.SetValue(x => x.EndDate, _autoFixture.Create <DateTime?>()); ContinuedApprenticeship.SetValue(x => x.StartDate, _autoFixture.Create <DateTime?>()); ContinuedApprenticeship.SetValue(x => x.CourseCode, _autoFixture.Create <string>()); ContinuedApprenticeship.SetValue(x => x.CourseName, _autoFixture.Create <string>()); ContinuedApprenticeship.SetValue(x => x.ProgrammeType, _autoFixture.Create <ProgrammeType>()); ContinuedApprenticeship.SetValue(x => x.EmployerRef, _autoFixture.Create <string>()); ContinuedApprenticeship.SetValue(x => x.ProviderRef, _autoFixture.Create <string>()); Request = new CommitmentsV2.Models.ChangeOfPartyRequest(); Request.SetValue(x => x.Apprenticeship, ContinuedApprenticeship); Request.SetValue(x => x.ApprenticeshipId, ContinuedApprenticeship.Id); Request.SetValue(x => x.StartDate, _autoFixture.Create <DateTime?>()); Request.SetValue(x => x.Price, _autoFixture.Create <int?>()); Request.SetValue(x => x.OriginatingParty, _autoFixture.Create <Party>()); }
public ChangeOfPartyRequestCreationTestFixture() { var autoFixture = new Fixture(); UnitOfWorkContext = new UnitOfWorkContext(); Now = DateTime.UtcNow; Apprenticeship = new CommitmentsV2.Models.Apprenticeship { Id = autoFixture.Create <long>(), Cohort = new CommitmentsV2.Models.Cohort { EmployerAccountId = autoFixture.Create <long>(), ProviderId = autoFixture.Create <long>() } }; RequestType = ChangeOfPartyRequestType.ChangeEmployer; OriginatingParty = Party.Provider; NewPartyId = autoFixture.Create <long>(); Price = autoFixture.Create <int>(); StartDate = autoFixture.Create <DateTime>(); EndDate = autoFixture.Create <DateTime?>(); UserInfo = new UserInfo(); }
public ApprenticeshipStatusTestsFixture() { _apprenticeship = new CommitmentsV2.Models.Apprenticeship(); _apprenticeship = new CommitmentsV2.Models.Apprenticeship { StartDate = DateTime.UtcNow.AddMonths(-1), EndDate = DateTime.UtcNow.AddYears(1), PaymentStatus = PaymentStatus.Active }; }
public WhenUpdatingCompletionDateFixture() { Now = DateTime.UtcNow; UnitOfWorkContext = new UnitOfWorkContext(); Cohort = new CommitmentsV2.Models.Cohort() .Set(c => c.Id, 111) .Set(c => c.EmployerAccountId, 222) .Set(c => c.ProviderId, 333); Apprenticeship = new CommitmentsV2.Models.Apprenticeship { Cohort = Cohort, PaymentStatus = PaymentStatus.Completed }; }
public WhenNewApprenticeshipIsSetFixture() { var autoFixture = new Fixture(); UnitOfWorkContext = new UnitOfWorkContext(); _cohort = new CommitmentsV2.Models.Cohort(); _cohort.SetValue(x => x.Id, autoFixture.Create <long>()); _cohort.SetValue(x => x.ProviderId, autoFixture.Create <long>()); _cohort.SetValue(x => x.EmployerAccountId, autoFixture.Create <long>()); _apprenticeship = new CommitmentsV2.Models.Apprenticeship(); _apprenticeship.SetValue(x => x.Id, autoFixture.Create <long>()); _apprenticeship.SetValue(x => x.Cohort, _cohort); _changeOfPartyRequest = autoFixture.Create <CommitmentsV2.Models.ChangeOfPartyRequest>(); }
public WhenCompletingApprenticeshipFixture() { _fixture = new Fixture(); _completionDate = _fixture.Create <DateTime>(); _unitOfWorkContext = new UnitOfWorkContext(); _cohort = new CommitmentsV2.Models.Cohort { Id = 234, EmployerAccountId = 234, ProviderId = 234 }; _apprenticeship = new CommitmentsV2.Models.Apprenticeship { Id = 64, Cohort = _cohort, StartDate = new DateTime(2020, 1, 1) }; }
public void CreateChangeOfPartyRequest() { try { Apprenticeship = new CommitmentsV2.Models.Apprenticeship { PaymentStatus = PaymentStatus, StopDate = StopDate, Cohort = new CommitmentsV2.Models.Cohort(), ChangeOfPartyRequests = PreviousChangeOfPartyRequests }; Result = Apprenticeship.CreateChangeOfPartyRequest(ChangeOfPartyRequestType.ChangeEmployer, Party.Provider, 1, 1000, StartDate, DateTime.UtcNow, new UserInfo(), DateTime.UtcNow); } catch (Exception e) { Exception = e; } }