当前位置: 首页>>代码示例>>C#>>正文


C# Project.Integrate方法代码示例

本文整理汇总了C#中Project.Integrate方法的典型用法代码示例。如果您正苦于以下问题:C# Project.Integrate方法的具体用法?C# Project.Integrate怎么用?C# Project.Integrate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Project的用法示例。


在下文中一共展示了Project.Integrate方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: IntegrateHandlesErrorDuringTriggerReset

 public void IntegrateHandlesErrorDuringTriggerReset()
 {
     var dummy = new TriggerStub
                     {
                         OnResetAction = () =>
                                             {
                                                 throw new Exception("Oops");
                                             }
                     };
     var executionFactoryMock = new Mock<ITaskExecutionFactory>(MockBehavior.Strict);
     InitialiseExecutionContext(executionFactoryMock);
     var project = new Project("test")
                       {
                           TaskExecutionFactory = executionFactoryMock.Object
                       };
     project.Triggers.Add(dummy);
     var request = new IntegrationRequest("Dummy");
     project.Integrate(request);
 }
开发者ID:BiYiTuan,项目名称:CruiseControl.NET,代码行数:19,代码来源:ProjectTests.cs

示例2: IntegrateSkipsTasksWhoseConditionsFail

 public void IntegrateSkipsTasksWhoseConditionsFail()
 {
     var conditionMock = new Mock<TaskCondition>(MockBehavior.Strict);
     conditionMock.Setup(c => c.Evaluate(It.IsAny<TaskExecutionContext>()))
         .Returns(false);
     var initialised = false;
     var ran = false;
     var cleanedUp = false;
     var dummy = new TaskStub
                     {
                         OnInitialiseAction = () => initialised = true,
                         OnRunAction = c =>
                                           {
                                               ran = true;
                                               return null;
                                           },
                         OnCleanUpAction = () => cleanedUp = true
                     };
     dummy.Conditions.Add(conditionMock.Object);
     var executionFactoryMock = new Mock<ITaskExecutionFactory>(MockBehavior.Strict);
     var contextMock = InitialiseExecutionContext(executionFactoryMock);
     contextMock.Setup(ec => ec.AddEntryToBuildLog("Task 'TaskStub' has been skipped"));
     var project = new Project("test", dummy)
                       {
                           TaskExecutionFactory = executionFactoryMock.Object
                       };
     var request = new IntegrationRequest("Dummy");
     project.Integrate(request);
     Assert.IsTrue(initialised);
     Assert.IsFalse(ran);
     Assert.IsTrue(cleanedUp);
 }
开发者ID:BiYiTuan,项目名称:CruiseControl.NET,代码行数:32,代码来源:ProjectTests.cs

示例3: IntegrateHandlesErrorDuringSourceControlCleanUp

 public void IntegrateHandlesErrorDuringSourceControlCleanUp()
 {
     var initialised = false;
     var dummy = new SourceControlBlockStub
     {
         OnInitialise = () => initialised = true,
         OnCleanUp = () =>
                         {
                             throw new Exception("Oops");
                         }
     };
     var executionFactoryMock = new Mock<ITaskExecutionFactory>(MockBehavior.Strict);
     InitialiseExecutionContext(executionFactoryMock);
     var project = new Project("test")
                       {
                           TaskExecutionFactory = executionFactoryMock.Object
                       };
     project.SourceControl.Add(dummy);
     var request = new IntegrationRequest("Dummy");
     project.Integrate(request);
     Assert.IsTrue(initialised);
 }
开发者ID:BiYiTuan,项目名称:CruiseControl.NET,代码行数:22,代码来源:ProjectTests.cs

示例4: IntegrateInitialisesAndCleansUpSourceControl

 public void IntegrateInitialisesAndCleansUpSourceControl()
 {
     var initialised = false;
     var cleanedUp = false;
     var dummy = new SourceControlBlockStub
         {
             OnInitialise = () => initialised = true,
             OnCleanUp = () => cleanedUp = true
         };
     var executionFactoryMock = new Mock<ITaskExecutionFactory>(MockBehavior.Strict);
     InitialiseExecutionContext(executionFactoryMock);
     var project = new Project("test")
                       {
                           TaskExecutionFactory = executionFactoryMock.Object
                       };
     project.SourceControl.Add(dummy);
     var request = new IntegrationRequest("Dummy");
     project.Integrate(request);
     Assert.IsTrue(initialised);
     Assert.IsTrue(cleanedUp);
 }
开发者ID:BiYiTuan,项目名称:CruiseControl.NET,代码行数:21,代码来源:ProjectTests.cs

示例5: IntegrateHandlesErrorDuringTaskCleanUp

 public void IntegrateHandlesErrorDuringTaskCleanUp()
 {
     var initialised = false;
     var ran = false;
     var dummy = new TaskStub
                     {
                         OnInitialiseAction = () => initialised = true,
                         OnRunAction = c =>
                                           {
                                               ran = true;
                                               return null;
                                           },
                         OnCleanUpAction = () =>
                                               {
                                                   throw new Exception("Oops");
                                               }
                     };
     var executionFactoryMock = new Mock<ITaskExecutionFactory>(MockBehavior.Strict);
     InitialiseExecutionContext(executionFactoryMock);
     var project = new Project("test", dummy)
                       {
                           TaskExecutionFactory = executionFactoryMock.Object
                       };
     var request = new IntegrationRequest("Dummy");
     project.Integrate(request);
     Assert.IsTrue(initialised);
     Assert.IsTrue(ran);
 }
开发者ID:BiYiTuan,项目名称:CruiseControl.NET,代码行数:28,代码来源:ProjectTests.cs

示例6: IntegrateHandlesErrorDuringInitialisation

 public void IntegrateHandlesErrorDuringInitialisation()
 {
     var ran = false;
     var cleanedUp = false;
     var dummy = new TaskStub
                     {
                         OnInitialiseAction = () =>
                                                  {
                                                      throw new Exception("Oops!");
                                                  },
                         OnRunAction = c =>
                                           {
                                               ran = true;
                                               return null;
                                           },
                         OnCleanUpAction = () => cleanedUp = true
                     };
     var project = new Project("test", dummy);
     var request = new IntegrationRequest("Dummy");
     project.Integrate(request);
     Assert.IsFalse(ran);
     Assert.IsTrue(cleanedUp);
 }
开发者ID:BiYiTuan,项目名称:CruiseControl.NET,代码行数:23,代码来源:ProjectTests.cs

示例7: IntegrateInitialisesRunsAndCleansUp

 public void IntegrateInitialisesRunsAndCleansUp()
 {
     var initialised = false;
     var ran = false;
     var cleanedUp = false;
     var dummy = new TaskStub
                     {
                         OnInitialiseAction = () => initialised = true,
                         OnRunAction = c => { ran = true; return null; },
                         OnCleanUpAction = () => cleanedUp = true
                     };
     var executionFactoryMock = new Mock<ITaskExecutionFactory>(MockBehavior.Strict);
     InitialiseExecutionContext(executionFactoryMock);
     var project = new Project("test", dummy)
                       {
                           TaskExecutionFactory = executionFactoryMock.Object
                       };
     var request = new IntegrationRequest("Dummy");
     project.Integrate(request);
     Assert.IsTrue(initialised);
     Assert.IsTrue(ran);
     Assert.IsTrue(cleanedUp);
 }
开发者ID:BiYiTuan,项目名称:CruiseControl.NET,代码行数:23,代码来源:ProjectTests.cs


注:本文中的Project.Integrate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。