Ejemplo n.º 1
0
        public void PipelineShouldNotifySuccessOnFinalBuildSuccess()
        {
            var lastStepMock = new Mock<IBuildStep>();
            lastStepMock.SetupProperty(s => s.SuccessCallback);

            var pipeline = new Pipeline(NotifierMock.Object, new Mock<IBuildStep>().Object, lastStepMock.Object);
            lastStepMock.Object.SuccessCallback(SingletonCommit());

            VerifyNotification(s => s.Contains("passed"));
        }
Ejemplo n.º 2
0
        public void PipelineShouldNotNotifyOnNonFinalBuildSuccess()
        {
            var firstStepMock = new Mock<IBuildStep>();
            firstStepMock.SetupProperty(s => s.SuccessCallback);

            var pipeline = new Pipeline(NotifierMock.Object, firstStepMock.Object, new Mock<IBuildStep>().Object);
            firstStepMock.Object.SuccessCallback(SingletonCommit());

            VerifyThereWereNoNotifications();
        }
Ejemplo n.º 3
0
        public void PipelineShouldNotifyFailureOnFinalBuildFailure()
        {
            var lastStepMock = new Mock<IBuildStep>();
            lastStepMock.SetupProperty(s => s.FailureCallback);

            var pipeline = new Pipeline(NotifierMock.Object, new Mock<IBuildStep>().Object, lastStepMock.Object);
            lastStepMock.Object.FailureCallback(SingletonCommit());

            VerifyNotification(s => s.Contains("failed"));
        }
Ejemplo n.º 4
0
        public void PipelineShouldNotNotifyOnPipelinesWithoutCommits()
        {
            var firstStepMock = new Mock<IBuildStep>();
            var lastStepMock = new Mock<IBuildStep>();
            firstStepMock.SetupAllProperties();
            lastStepMock.SetupAllProperties();

            var pipeline = new Pipeline(NotifierMock.Object, firstStepMock.Object, lastStepMock.Object);
            firstStepMock.Object.SuccessCallback(new List<ICommit>());
            lastStepMock.Object.SuccessCallback(new List<ICommit>());

            VerifyThereWereNoNotifications();
        }
Ejemplo n.º 5
0
        public void PipelineShouldPassCommitsIntoFirstBuildStep()
        {
            var stepMock = new Mock<IBuildStep>();
            var pipeline = new Pipeline(NotifierMock.Object, stepMock.Object);

            var commit = NewCommit();
            pipeline.AddToPipeline(commit);

            stepMock.Verify(s => s.AddWaitingCommit(commit));
        }