public void Setup() { _fixture = new Fixture(); _repairsGatewayMock = new MockRepairsGateway(); _authMock = new AuthorisationMock(); _authMock.SetPolicyResult("RaiseSpendLimit", true); _scheduleOfRatesGateway = new Mock <IScheduleOfRatesGateway>(); ContractorUsesExternalScheduler(false); _currentUserServiceMock = new CurrentUserServiceMock(); _featureManagerMock = new Mock <IFeatureManager>(); _featureManagerMock.Setup(fm => fm.IsEnabledAsync(It.IsAny <string>())).ReturnsAsync(true); _notificationMock = new NotificationMock(); _drsOptions = new DrsOptions { Login = "******", Password = "******", APIAddress = new Uri("https://apiAddress.none"), ManagementAddress = new Uri("https://managementAddress.none") }; _classUnderTest = new CreateWorkOrderUseCase( _repairsGatewayMock.Object, _scheduleOfRatesGateway.Object, new NullLogger <CreateWorkOrderUseCase>(), _currentUserServiceMock.Object, _authMock.Object, _featureManagerMock.Object, _notificationMock, Options.Create(_drsOptions) ); }
public void Setup() { _fixture = new Fixture(); _fixture.Behaviors.Remove(new ThrowingRecursionBehavior()); _fixture.Behaviors.Add(new OmitOnRecursionBehavior()); _currentUserServiceMock = new CurrentUserServiceMock(); _notifierMock = new NotificationMock(); _expectedName = "Expected Name"; _currentUserServiceMock.SetUser("1111", "*****@*****.**", _expectedName); _authorisationMock = new AuthorisationMock(); _authorisationMock.SetPolicyResult("RaiseSpendLimit", true); _classUnderTest = new ApproveWorkOrderStrategy( _currentUserServiceMock.Object, _notifierMock, _authorisationMock.Object ); }
public void Setup() { _fixture = new Fixture(); _fixture.Behaviors.Remove(new ThrowingRecursionBehavior()); _fixture.Behaviors.Add(new OmitOnRecursionBehavior()); _repairsGatewayMock = new MockRepairsGateway(); _currentUserServiceMock = new CurrentUserServiceMock(); _jobStatusUpdateGateway = new Mock <IJobStatusUpdateGateway>(); _updateSorCodesUseCaseMock = new Mock <IUpdateSorCodesUseCase>(); _expectedName = "Expected Name"; _currentUserServiceMock.SetUser("1111", "*****@*****.**", _expectedName); _notifierMock = new NotificationMock(); _authorisationMock = new AuthorisationMock(); _authorisationMock.SetPolicyResult("VarySpendLimit", true); _classUnderTest = new ApproveVariationUseCase( _repairsGatewayMock.Object, _jobStatusUpdateGateway.Object, _currentUserServiceMock.Object, _updateSorCodesUseCaseMock.Object, _notifierMock, _authorisationMock.Object); }
public void Setup() { _fixture = new Fixture(); _fixture.Behaviors.Remove(new ThrowingRecursionBehavior()); _fixture.Behaviors.Add(new OmitOnRecursionBehavior()); _authorisationMock = new AuthorisationMock(); _featureManagerMock = new FeatureManagerMock(); _currentUserServiceMock = new CurrentUserServiceMock(); _updateSorCodesUseCaseMock = new Mock <IUpdateSorCodesUseCase>(); _sheduleOfRatesGateway = new Mock <IScheduleOfRatesGateway>(); _sheduleOfRatesGateway.Setup(g => g.GetCost(It.IsAny <string>(), It.IsAny <string>())).ReturnsAsync(10.0); _notifierMock = new NotificationMock(); _classUnderTest = new MoreSpecificSorUseCase( _authorisationMock.Object, _featureManagerMock.Object, _currentUserServiceMock.Object, _updateSorCodesUseCaseMock.Object, _sheduleOfRatesGateway.Object, _notifierMock); }