示例#1
0
        public void CreateVacancyShouldCallRepository()
        {
            // Arrange.
            _mockCurrentUserService.Setup(cus => cus.CurrentUserName).Returns(_vacancyManager.Username);
            _mockCurrentUserService.Setup(cus => cus.IsInRole(Roles.Faa)).Returns(true);

            var vacancy = new Vacancy
            {
                VacancyReferenceNumber = 1,
                VacancyId = 1
            };

            _mockApprenticeshipVacancyWriteRepository.Setup(r => r.Create(vacancy)).Returns(vacancy);

            // Act.
            _createVacancyStrategy.CreateVacancy(vacancy);

            // Assert.
            _mockApprenticeshipVacancyWriteRepository.Verify(r => r.Create(vacancy));
        }
示例#2
0
 public Vacancy CreateVacancy(Vacancy vacancy)
 {
     return(_createVacancyStrategy.CreateVacancy(vacancy));
 }