public void Arrange() { _fixture = new Fixture(); _applicationId = Guid.NewGuid(); _hashedAccountId = Guid.NewGuid().ToString(); _apprenticesServiceMock = new Mock <IApprenticesService>(); _applicationServiceMock = new Mock <IApplicationService>(); _sut = new Web.Controllers.ApplyApprenticeshipsController(_apprenticesServiceMock.Object, _applicationServiceMock.Object, Mock.Of <ILegalEntitiesService>()); }
public void Arrange() { _fixture = new Fixture(); _accountId = _fixture.Create <string>(); _accountLegalEntityId = _fixture.Create <string>(); _applicationId = Guid.NewGuid(); _mockApprenticesService = new Mock <IApprenticesService>(); _mockLegalEntitiesService = new Mock <ILegalEntitiesService>(); _mockApplicationService = new Mock <IApplicationService>(); _mockConfiguration = new Mock <IOptions <ExternalLinksConfiguration> >(); _sut = new Web.Controllers.ApplyApprenticeshipsController( _mockApprenticesService.Object, _mockApplicationService.Object, _mockLegalEntitiesService.Object); }
public async Task Arrange() { _applicationId = Guid.NewGuid(); _apprenticeData = new Fixture().CreateMany <ApprenticeshipModel>(); _hashedAccountId = Guid.NewGuid().ToString(); _hashedLegalEntityId = Guid.NewGuid().ToString(); _apprenticesServiceMock = new Mock <IApprenticesService>(); _apprenticesServiceMock .Setup(x => x.Get(It.Is <ApprenticesQuery>(q => q.AccountId == _hashedAccountId && q.AccountLegalEntityId == _hashedLegalEntityId))) .ReturnsAsync(_apprenticeData); _applicationServiceMock = new Mock <IApplicationService>(); _applicationServiceMock .Setup(x => x.Create(_hashedAccountId, _hashedLegalEntityId, It.IsAny <IEnumerable <string> >())) .ReturnsAsync(_applicationId); _sut = new Web.Controllers.ApplyApprenticeshipsController(_apprenticesServiceMock.Object, _applicationServiceMock.Object, Mock.Of <ILegalEntitiesService>()); _result = await _sut.SelectApprenticeships(_hashedAccountId, _hashedLegalEntityId); _model = ((ViewResult)_result).Model as SelectApprenticeshipsViewModel; }