示例#1
0
        public void Test_1()
        {
            var projectFileName = TestDirectory + @"GlueTestProject\GlueTestProject\GlueTestProject\GlueTestProject.csproj";

            //Start up Glue
            AutoGlue.Start();
            ProjectLoader.Self.LoadProject(projectFileName);

            //Build Project
            var pc = new ProjectCollection();

            var fileLogger = new OutputLogger();

            pc.RegisterLogger(fileLogger);

            var p = pc.LoadProject(projectFileName);

            p.SetProperty("Configuration", "UnitTests");
            Assert.AreEqual(true, p.Build(), "Failed to build project.");

            //Run Project
            var proc = new Process
            {
                StartInfo =
                {
                    UseShellExecute = false,
                    FileName        =
                        TestDirectory +
                        @"GlueTestProject\GlueTestProject\GlueTestProject\bin\x86\Debug\GlueTestProject.exe",
                    RedirectStandardError = true
                }
            };

            proc.Start();
            proc.WaitForExit();
            Trace.Write(proc.StandardError.ReadToEnd());
            Assert.AreEqual(0, proc.ExitCode);
        }
示例#2
-1
        public void Test_1()
        {
            var projectFileName = TestDirectory + @"GlueTestProject\GlueTestProject\GlueTestProject\GlueTestProject.csproj";

            //Start up Glue
            AutoGlue.Start();
            ProjectLoader.Self.LoadProject(projectFileName);

            //Build Project
            var pc = new ProjectCollection();

            var fileLogger = new OutputLogger();
            pc.RegisterLogger(fileLogger);

            var p = pc.LoadProject(projectFileName);
            p.SetProperty("Configuration", "UnitTests");
            Assert.AreEqual(true, p.Build(), "Failed to build project.");

            //Run Project
            var proc = new Process
                           {
                               StartInfo =
                                   {
                                       UseShellExecute = false,
                                       FileName =
                                           TestDirectory +
                                           @"GlueTestProject\GlueTestProject\GlueTestProject\bin\x86\Debug\GlueTestProject.exe",
                                       RedirectStandardError = true
                                   }
                           };
            proc.Start();
            proc.WaitForExit();
            Trace.Write(proc.StandardError.ReadToEnd());
            Assert.AreEqual(0, proc.ExitCode);
        }