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)
         );
 }
Beispiel #2
0
        public void Setup()
        {
            _fixture                 = new Fixture();
            _repairsGatewayMock      = new MockRepairsGateway();
            _appointmentsGatewayMock = new Mock <IAppointmentsGateway>();
            _drsOptions              = new DrsOptions
            {
                Login             = "******",
                Password          = "******",
                APIAddress        = new Uri("https://apiAddress.none"),
                ManagementAddress = new Uri("https://managementAddress.none")
            };
            _featureManager = new Mock <IFeatureManager>();
            _drsService     = new Mock <IDrsService>();
            _sorGatewayMock = new Mock <IScheduleOfRatesGateway>();
            _loggerMock     = new Mock <ILogger <GetWorkOrderUseCase> >();


            _sorGatewayMock.Setup(mock => mock.GetContractor(It.IsAny <string>())).ReturnsAsync(new RepairsApi.V2.Domain.Contractor
            {
                CanAssignOperative = true
            });
            _classUnderTest = new GetWorkOrderUseCase(
                _repairsGatewayMock.Object,
                _appointmentsGatewayMock.Object,
                Options.Create(_drsOptions),
                _featureManager.Object,
                _drsService.Object,
                _sorGatewayMock.Object,
                _loggerMock.Object
                );
            ConfigureGenerator();
        }
Beispiel #3
0
 public void Setup()
 {
     _fixture = new Fixture();
     _fixture.Behaviors.Remove(new ThrowingRecursionBehavior());
     _fixture.Behaviors.Add(new OmitOnRecursionBehavior());
     _repairsGatewayMock = new MockRepairsGateway();
     _classUnderTest     = new JobIncompleteNeedMaterialsStrategy(_repairsGatewayMock.Object);
 }
Beispiel #4
0
 public void Setup()
 {
     _fixture = new Fixture();
     _fixture.Behaviors.Remove(new ThrowingRecursionBehavior());
     _fixture.Behaviors.Add(new OmitOnRecursionBehavior());
     _repairsGatewayMock     = new MockRepairsGateway();
     _currentUserServiceMock = new CurrentUserServiceMock();
     _classUnderTest         = new ContractorAcknowledgeVariationUseCase(
         _repairsGatewayMock.Object,
         _currentUserServiceMock.Object);
 }
Beispiel #5
0
 public void Setup()
 {
     _fixture = new Fixture();
     _fixture.Behaviors.Remove(new ThrowingRecursionBehavior());
     _fixture.Behaviors.Add(new OmitOnRecursionBehavior());
     _repairsGatewayMock         = new MockRepairsGateway();
     _currentUserServiceMock     = new CurrentUserServiceMock();
     _jobStatusUpdateGatewayMock = new Mock <IJobStatusUpdateGateway>();
     _notifier       = new NotificationMock();
     _classUnderTest = new RejectVariationUseCase(
         _repairsGatewayMock.Object,
         _currentUserServiceMock.Object,
         _jobStatusUpdateGatewayMock.Object,
         _notifier);
 }
        public void Setup()
        {
            _fixture = new Fixture();
            _fixture.Behaviors.Remove(new ThrowingRecursionBehavior());
            _fixture.Behaviors.Add(new OmitOnRecursionBehavior());

            _repairsGatewayMock     = new MockRepairsGateway();
            _jobStatusUpdateGateway = new Mock <IJobStatusUpdateGateway>();
            _strategyFactory        = new Mock <IJobStatusUpdateStrategyFactory>();
            _classUnderTest         = new UpdateJobStatusUseCase(
                _repairsGatewayMock.Object,
                _jobStatusUpdateGateway.Object,
                _strategyFactory.Object
                );
        }
Beispiel #7
0
        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);
        }
Beispiel #8
0
 public void Setup()
 {
     _repairsGatewayMock         = new MockRepairsGateway();
     _jobStatusUpdateGatewayMock = new Mock <IJobStatusUpdateGateway>();
     _classUnderTest             = new ListVariationTasksUseCase(_jobStatusUpdateGatewayMock.Object, _repairsGatewayMock.Object);
 }
Beispiel #9
0
 public void Setup()
 {
     ConfigureGenerator();
     _repairsMock    = new MockRepairsGateway();
     _classUnderTest = new ListWorkOrdersUseCase(_repairsMock.Object, CreateFilterBuilder());
 }