本文整理汇总了C#中Microsoft.Build.BackEnd.BuildRequestEntry.Complete方法的典型用法代码示例。如果您正苦于以下问题:C# BuildRequestEntry.Complete方法的具体用法?C# BuildRequestEntry.Complete怎么用?C# BuildRequestEntry.Complete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.Build.BackEnd.BuildRequestEntry
的用法示例。
在下文中一共展示了BuildRequestEntry.Complete方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestNoCompleteToWaiting
public void TestNoCompleteToWaiting()
{
BuildRequest request = CreateNewBuildRequest(1, new string[1] { "foo" });
BuildRequestConfiguration config = new BuildRequestConfiguration(1, new BuildRequestData("foo", new Dictionary<string, string>(), "foo", new string[0], null), "2.0");
BuildRequestEntry entry = new BuildRequestEntry(request, config);
Assert.AreEqual(entry.State, BuildRequestEntryState.Ready);
entry.Continue();
Assert.AreEqual(entry.State, BuildRequestEntryState.Active);
BuildResult requiredResult = new BuildResult(request);
requiredResult.AddResultsForTarget("foo", TestUtilities.GetEmptySucceedingTargetResult());
entry.Complete(requiredResult);
Assert.AreEqual(entry.State, BuildRequestEntryState.Complete);
BuildRequest waitingRequest1 = CreateNewBuildRequest(2, new string[1] { "bar" });
entry.WaitForResult(waitingRequest1);
}
示例2: TestSimpleStateProgression
public void TestSimpleStateProgression()
{
// Start in Ready
BuildRequest request = CreateNewBuildRequest(1, new string[1] { "foo" });
BuildRequestConfiguration config = new BuildRequestConfiguration(1, new BuildRequestData("foo", new Dictionary<string, string>(), "foo", new string[0], null), "2.0");
BuildRequestEntry entry = new BuildRequestEntry(request, config);
Assert.AreEqual(entry.State, BuildRequestEntryState.Ready);
Assert.AreEqual(entry.Request, request);
Assert.IsNull(entry.Result);
// Move to active. Should not be any results yet.
IDictionary<int, BuildResult> results = entry.Continue();
Assert.AreEqual(entry.State, BuildRequestEntryState.Active);
Assert.IsNull(entry.Result);
Assert.IsNull(results);
// Wait for results, move to waiting.
BuildRequest waitingRequest = CreateNewBuildRequest(2, new string[1] { "bar" });
entry.WaitForResult(waitingRequest);
Assert.AreEqual(entry.State, BuildRequestEntryState.Waiting);
Assert.AreEqual(entry.Request, request);
Assert.IsNull(entry.Result);
// Provide the results, move to ready.
BuildResult requiredResult = new BuildResult(waitingRequest);
requiredResult.AddResultsForTarget("bar", TestUtilities.GetEmptySucceedingTargetResult());
entry.ReportResult(requiredResult);
Assert.AreEqual(entry.State, BuildRequestEntryState.Ready);
Assert.AreEqual(entry.Request, request);
Assert.IsNull(entry.Result);
// Continue the build, move to active.
results = entry.Continue();
Assert.AreEqual(entry.State, BuildRequestEntryState.Active);
Assert.IsNull(entry.Result);
Assert.AreEqual(results.Count, 1);
Assert.IsTrue(results.ContainsKey(requiredResult.NodeRequestId));
Assert.AreEqual(results[requiredResult.NodeRequestId], requiredResult);
// Complete the build, move to completed.
BuildResult result = new BuildResult(request);
result.AddResultsForTarget("foo", TestUtilities.GetEmptySucceedingTargetResult());
entry.Complete(result);
Assert.AreEqual(entry.State, BuildRequestEntryState.Complete);
Assert.IsNotNull(entry.Result);
Assert.AreEqual(entry.Result, result);
}
示例3: TestNoReadyToComplete
public void TestNoReadyToComplete()
{
BuildRequest request = CreateNewBuildRequest(1, new string[1] { "foo" });
BuildRequestData data1 = new BuildRequestData("foo", new Dictionary<string, string>(), "foo", new string[0], null);
BuildRequestConfiguration config = new BuildRequestConfiguration(1, data1, "2.0");
BuildRequestEntry entry = new BuildRequestEntry(request, config);
Assert.AreEqual(entry.State, BuildRequestEntryState.Ready);
BuildResult requiredResult = new BuildResult(request);
requiredResult.AddResultsForTarget("foo", TestUtilities.GetEmptySucceedingTargetResult());
entry.Complete(requiredResult);
}