本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}