Пример #1
0
        public void Setup()
        {
            this.mocks = new MockRepository(MockBehavior.Default);

            mockery           = new Mockery();
            targetMock        = mockery.NewDynamicMock <IIntegrationRunnerTarget>();
            resultManagerMock = mockery.NewDynamicMock <IIntegrationResultManager>();
            quietPeriodMock   = mockery.NewDynamicMock <IQuietPeriod>();

            runner = new IntegrationRunner((IIntegrationResultManager)resultManagerMock.Object,
                                           (IIntegrationRunnerTarget)targetMock.Object,
                                           (IQuietPeriod)quietPeriodMock.Object);


            request       = ModificationExistRequest();
            endTime       = new DateTime(2005, 2, 1);
            modifications = new Modification[] { new Modification() };

            resultMock = mockery.NewDynamicMock <IIntegrationResult>();
            resultMock.SetupGet(_result => _result.WorkingDirectory).Returns(TempFileUtil.GetTempPath("workingDir"));
            resultMock.SetupGet(_result => _result.ArtifactDirectory).Returns(TempFileUtil.GetTempPath("artifactDir"));
            resultMock.SetupGet(_result => _result.BuildProgressInformation).Returns(new ThoughtWorks.CruiseControl.Core.Util.BuildProgressInformation("", string.Empty));
            resultMock.SetupGet(_result => _result.IntegrationProperties).Returns(new Dictionary <string, string>());
            result = (IIntegrationResult)resultMock.Object;

            lastResultMock = mockery.NewDynamicMock <IIntegrationResult>();
            lastResult     = (IIntegrationResult)lastResultMock.Object;
        }