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)); }
public Vacancy CreateVacancy(Vacancy vacancy) { return(_createVacancyStrategy.CreateVacancy(vacancy)); }