示例#1
0
        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);
        }
示例#2
0
        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);
        }
示例#3
0
        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);
        }
示例#4
0
        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);
        }
示例#5
0
        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);
        }
示例#6
0
        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);
        }
示例#7
0
        public void GivenInvalidVacancyIdString_ThenVacancyNotFound(string vacancyId)
        {
            var response = Mediator.Apply(Guid.NewGuid(), vacancyId);

            response.AssertCode(TraineeshipApplicationMediatorCodes.Apply.VacancyNotFound, false);
        }