public void Setup()
 {
     _fixture = new Fixture();
     _fixture.Behaviors.Remove(new ThrowingRecursionBehavior());
     _fixture.Behaviors.Add(new OmitOnRecursionBehavior());
     _currentUserServiceMock = new CurrentUserServiceMock();
     _notifierMock           = new NotificationMock();
     _classUnderTest         = new RejectWorkOrderStrategy(
         _currentUserServiceMock.Object,
         _notifierMock
         );
 }
Example #2
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());
     _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
         );
 }
Example #4
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);
        }
Example #5
0
 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);
 }