示例#1
0
        public void DeployerService_should_return_only_return_maximum_requested_recent_events()
        {
            // Arrange
            var deploymentEventAccessor = MockRepository.GenerateStub <IDeploymentEventAccessor>();

            deploymentEventAccessor.Stub(o => o.Events)
            .Return(new[] { new DeploymentEvent(), new DeploymentEvent() });

            var deployerService = new DeployerService(null, deploymentEventAccessor);

            // Act
            var events = deployerService.RecentEvents(1);

            // Assert
            Assert.AreEqual(1, events.Length);
        }
示例#2
0
        public void DeployerService_should_return_output_from_accessor_by_id()
        {
            // Arrange
            const int    deploymentId            = 17;
            const string expectedContent         = "Howdy!";
            var          deploymentEventAccessor = MockRepository.GenerateStub <IDeploymentEventAccessor>();

            deploymentEventAccessor.Stub(o => o.GetDeploymentOutput(deploymentId))
            .Return(new DeploymentOutput {
                Content = expectedContent
            });

            var deployerService = new DeployerService(null, deploymentEventAccessor);

            // Act
            var deploymentOutput = deployerService.GetDeploymentOutput(deploymentId);

            // Assert
            Assert.AreEqual(expectedContent, deploymentOutput.Content);
        }