private BuildRequest CreateBuildRequest(int nodeRequestId, int configId, string[] targets, NodeAffinity nodeAffinity, BuildRequest parentRequest, ProxyTargets proxyTargets = null) { (targets == null ^ proxyTargets == null).ShouldBeTrue(); HostServices hostServices = null; if (nodeAffinity != NodeAffinity.Any) { hostServices = new HostServices(); hostServices.SetNodeAffinity(String.Empty, nodeAffinity); } if (targets != null) { return(new BuildRequest( submissionId: 1, nodeRequestId, configId, targets, hostServices, BuildEventContext.Invalid, parentRequest)); } parentRequest.ShouldBeNull(); return(new BuildRequest( submissionId: 1, nodeRequestId, configId, proxyTargets, hostServices)); }