public void TestResolveConfiguration()
        {
            BuildRequest request = CreateNewBuildRequest(1, new string[1] {
                "foo"
            });
            BuildRequestData          data1  = new BuildRequestData("foo", new Dictionary <string, string>(), "foo", Array.Empty <string>(), null);
            BuildRequestConfiguration config = new BuildRequestConfiguration(1, data1, "2.0");
            BuildRequestEntry         entry  = new BuildRequestEntry(request, config);

            entry.Continue();
            Assert.Equal(BuildRequestEntryState.Active, entry.State);

            BuildRequest waitingRequest = CreateNewBuildRequest(-1, new string[1] {
                "bar"
            });

            entry.WaitForResult(waitingRequest);

            entry.ResolveConfigurationRequest(-1, 2);

            BuildResult requiredResult = new BuildResult(waitingRequest);

            requiredResult.AddResultsForTarget("bar", BuildResultUtilities.GetEmptySucceedingTargetResult());
            entry.ReportResult(requiredResult);
            Assert.Equal(BuildRequestEntryState.Ready, entry.State);
        }
        public void TestMixedWaitingRequests()
        {
            BuildRequest request = CreateNewBuildRequest(1, new string[1] {
                "foo"
            });
            BuildRequestConfiguration config = new BuildRequestConfiguration(1, new BuildRequestData("foo", new Dictionary <string, string>(), "foo", Array.Empty <string>(), null), "2.0");
            BuildRequestEntry         entry  = new BuildRequestEntry(request, config);

            Assert.Equal(BuildRequestEntryState.Ready, entry.State);

            entry.Continue();
            Assert.Equal(BuildRequestEntryState.Active, entry.State);

            BuildRequest waitingRequest1 = CreateNewBuildRequest(2, new string[1] {
                "bar"
            });

            entry.WaitForResult(waitingRequest1);
            Assert.Equal(BuildRequestEntryState.Waiting, entry.State);

            BuildRequest waitingRequest2 = CreateNewBuildRequest(-1, new string[1] {
                "xor"
            });

            entry.WaitForResult(waitingRequest2);
            Assert.Equal(BuildRequestEntryState.Waiting, entry.State);

            Assert.Null(entry.GetRequestsToIssueIfReady()); // "Entry should not be ready to issue because there are unresolved configurations"

            entry.ResolveConfigurationRequest(-1, 3);
            Assert.Equal(BuildRequestEntryState.Waiting, entry.State);

            BuildResult requiredResult1 = new BuildResult(waitingRequest1);

            requiredResult1.AddResultsForTarget("bar", BuildResultUtilities.GetEmptySucceedingTargetResult());
            entry.ReportResult(requiredResult1);
            Assert.Equal(BuildRequestEntryState.Waiting, entry.State);

            BuildResult requiredResult2 = new BuildResult(waitingRequest2);

            requiredResult2.AddResultsForTarget("xor", BuildResultUtilities.GetEmptySucceedingTargetResult());
            entry.ReportResult(requiredResult2);
            Assert.Equal(BuildRequestEntryState.Ready, entry.State);
        }