public void HasError() { TraineeshipApplicationProvider.Setup(p => p.GetApplicationViewModel(It.IsAny <Guid>(), InvalidVacancyId)).Returns(new TraineeshipApplicationViewModel("Vacancy not found")); var response = Mediator.Apply(Guid.NewGuid(), InvalidVacancyId.ToString()); response.AssertCode(TraineeshipApplicationMediatorCodes.Apply.HasError, false); }
public void Ok() { TraineeshipApplicationProvider.Setup(p => p.GetApplicationViewModel(It.IsAny <Guid>(), ValidVacancyId)).Returns(new TraineeshipApplicationViewModel()); var response = Mediator.Apply(Guid.NewGuid(), ValidVacancyId.ToString()); response.AssertCode(TraineeshipApplicationMediatorCodes.Apply.Ok, true); }
public void HasError() { ApprenticeshipApplicationProvider.Setup(p => p.GetOrCreateApplicationViewModel(It.IsAny <Guid>(), InvalidVacancyId)).Returns(new ApprenticeshipApplicationViewModel("Vacancy has error")); var response = Mediator.Apply(Guid.NewGuid(), InvalidVacancyId.ToString()); response.AssertCode(ApprenticeshipApplicationMediatorCodes.Apply.HasError, false); }
public void VacancyNotFound() { ApprenticeshipApplicationProvider.Setup(p => p.GetOrCreateApplicationViewModel(It.IsAny <Guid>(), InvalidVacancyId)).Returns(new ApprenticeshipApplicationViewModel { Status = ApplicationStatuses.ExpiredOrWithdrawn, VacancyDetail = new VacancyDetailViewModel() }); var response = Mediator.Apply(Guid.NewGuid(), InvalidVacancyId.ToString()); response.AssertCode(ApprenticeshipApplicationMediatorCodes.Apply.VacancyNotFound, false); }
public void OfflineVacancy() { ApprenticeshipApplicationProvider.Setup(p => p.GetOrCreateApplicationViewModel(It.IsAny <Guid>(), ValidVacancyId)).Returns(new ApprenticeshipApplicationViewModel { VacancyDetail = new VacancyDetailViewModel { ApplyViaEmployerWebsite = true } }); var response = Mediator.Apply(Guid.NewGuid(), ValidVacancyId.ToString()); response.AssertCode(ApprenticeshipApplicationMediatorCodes.Apply.OfflineVacancy, false); }
public void Ok() { ApprenticeshipApplicationProvider.Setup(p => p.GetOrCreateApplicationViewModel(It.IsAny <Guid>(), ValidVacancyId)).Returns(new ApprenticeshipApplicationViewModel { VacancyDetail = new VacancyDetailViewModel { VacancyStatus = VacancyStatuses.Live } }); var response = Mediator.Apply(Guid.NewGuid(), ValidVacancyId.ToString()); response.AssertCode(ApprenticeshipApplicationMediatorCodes.Apply.Ok, true); }
public void GivenInvalidVacancyIdString_ThenVacancyNotFound(string vacancyId) { var response = Mediator.Apply(Guid.NewGuid(), vacancyId); response.AssertCode(TraineeshipApplicationMediatorCodes.Apply.VacancyNotFound, false); }