Beispiel #1
0
        public void CscHostObjectNotUsedIfToolPathSpecified()
        {
            IBuildEngine2 mockEngine = new MockEngine();
            Csc           csc        = new Csc();

            csc.BuildEngine = mockEngine;
            MockCscHostObject cscHostObject = new MockCscHostObject();

            csc.HostObject = cscHostObject;
            csc.UseHostCompilerIfAvailable = true;
            csc.ToolPath = "c:\\some\\custom\\path";

            Assert.IsTrue(csc.UseAlternateCommandLineToolToExecute());
        }
Beispiel #2
0
        public void CscHostObject()
        {
            IBuildEngine2 mockEngine = new MockEngine();
            Csc           csc        = new Csc();

            csc.BuildEngine = mockEngine;
            MockCscHostObject cscHostObject = new MockCscHostObject();

            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);
        }
Beispiel #3
0
        public void CscHostObjectNotUsedIfToolPathSpecified()
        {
            IBuildEngine2 mockEngine = new MockEngine();
            Csc csc = new Csc();
            csc.BuildEngine = mockEngine;
            MockCscHostObject cscHostObject = new MockCscHostObject();
            csc.HostObject = cscHostObject;
            csc.UseHostCompilerIfAvailable = true;
            csc.ToolPath = "c:\\some\\custom\\path";

            Assert.IsTrue(csc.UseAlternateCommandLineToolToExecute());
        }
Beispiel #4
0
        public void CscHostObject()
        {
            IBuildEngine2 mockEngine = new MockEngine();
            Csc csc = new Csc();
            csc.BuildEngine = mockEngine;
            MockCscHostObject cscHostObject = new MockCscHostObject();
            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);
        }