public void CscHostObject3() { IBuildEngine2 mockEngine = new MockEngine(); Csc csc = new Csc(); csc.BuildEngine = mockEngine; MockCscHostObject3 cscHostObject = new MockCscHostObject3(); csc.HostObject = cscHostObject; csc.UseHostCompilerIfAvailable = true; Assert.IsTrue(!cscHostObject.CompileMethodWasCalled); csc.Sources = new TaskItem[] { new TaskItem("a.cs") }; bool cscSuccess = csc.Execute(); Assert.IsTrue(cscSuccess, "Csc task failed."); Assert.IsTrue(cscHostObject.CompileMethodWasCalled); }