Ejemplo n.º 1
0
        protected override void OnExecute(IJobExecutionContext context)
        {
            var buildServerId = GetBuildServerId(context);

            var command = new SyncBuildAgentsCommand(buildServerId);

            this.mediator.Send(command);
        }
Ejemplo n.º 2
0
        public void CanHandleSyncBuildAgentsCommand()
        {
            var mediator = new Mock<IMediator>();
            var session = new Mock<IDocumentSession>();
            var command = new SyncBuildAgentsCommand("buildServers/1");
            var requestHandler = new SyncBuildAgentsCommandHandler(mediator.Object, session.Object);
            
            var response = requestHandler.Handle(command);

            Assert.AreEqual(ResponseStatus.Success, response.Status);
        }