예제 #1
0
 public WorkItemCreatedHandler(IWorkItemAuditService workItemAuditService, ILoggerAdapter <WorkItemCreatedHandler> logger, IUserService userService, IBus bus)
 {
     _workItemAuditService = workItemAuditService;
     _logger      = logger;
     _userService = userService;
     _bus         = bus;
 }
예제 #2
0
        public WorkItemDeletedHandlerTests()
        {
            _logger = Substitute.For <ILoggerAdapter <WorkItemDeletedHandler> >();
            _workItemAuditService = Substitute.For <IWorkItemAuditService>();

            _context = Substitute.For <ConsumeContext <WorkItemDeleted> >();

            _handler = new WorkItemDeletedHandler(_logger, _workItemAuditService);
        }
예제 #3
0
        public WorkItemCreatedHandlerTests()
        {
            _workItemAuditService = Substitute.For <IWorkItemAuditService>();
            _logger      = Substitute.For <ILoggerAdapter <WorkItemCreatedHandler> >();
            _userService = Substitute.For <IUserService>();
            _bus         = Substitute.For <IBus>();
            _context     = Substitute.For <ConsumeContext <WorkItemCreated> >();


            _userService.GetById(1).Returns(UserDto);
            _userService.GetById(2).Returns <UserDto>(value => null);

            _workItemAuditService.WICreated(1, Arg.Any <WorkItemHistoryDto>()).Returns(WorkItemAuditDto);
            _workItemAuditService.WICreated(2, ValidNewWorkItem).Returns(WorkItemAuditDto);

            _handler = new WorkItemCreatedHandler(_workItemAuditService, _logger, _userService, _bus);
        }
예제 #4
0
        public WorkItemChangedHandlerTests()
        {
            _workItemService      = Substitute.For <IWorkItemService>();
            _userService          = Substitute.For <IUserService>();
            _consumeContext       = Substitute.For <ConsumeContext <WorkItemUpdated> >();
            _bus                  = Substitute.For <IBus>();
            _logger               = Substitute.For <ILoggerAdapter <WorkItemChangedHandler> >();
            _workItemAuditService = Substitute.For <IWorkItemAuditService>();

            _workItemService.GetById(1).Returns(WorkItem);
            _workItemService.GetById(2).Returns(WorkItemWithNotValidAssignee);
            _workItemService.GetById(3).Returns <WorkItemDto>(value => null);

            _userService.GetById(1).Returns(User);
            _userService.GetById(2).Returns <UserDto>(value => null);


            _handler = new WorkItemChangedHandler(_workItemService, _userService, _bus, _logger, _workItemAuditService);
        }
 public WorkItemAuditsController(IWorkItemAuditService workItemAuditService)
 {
     _workItemAuditService = workItemAuditService;
 }
 public WorkItemDeletedHandler(ILoggerAdapter <WorkItemDeletedHandler> logger, IWorkItemAuditService workItemAuditService)
 {
     _logger = logger;
     _workItemAuditService = workItemAuditService;
 }