コード例 #1
0
		public void CoreNewLine ()
		{
			MyTextWriter w = new MyTextWriter ();
			AssertNotNull (w.NewLine);

			w.UpdateLine ();
			AssertEquals ('Z', w.NewLine [0]);

			w.UpdateLine2 ();
			AssertEquals ('Y', w.NewLine [0]);
		}
コード例 #2
0
        public void CoreNewLine()
        {
            MyTextWriter w = new MyTextWriter();

            Assert.IsNotNull(w.NewLine);

            w.UpdateLine();
            Assert.AreEqual('Z', w.NewLine [0]);

            w.UpdateLine2();
            Assert.AreEqual('Y', w.NewLine [0]);
        }
コード例 #3
0
        private string RunProject(string aProjectFile, string aParams, bool aSuccessFullBuild)
        {
            // create a writer to save command line output
            MyTextWriter lMyWriter = new MyTextWriter();

            // set it so the output goes to my writer
            Console.SetOut(lMyWriter);
            // get current dir
            string lBinDir = System.IO.Directory.GetCurrentDirectory();
            // create full path to project
            string lProjectFile = System.IO.Directory.GetCurrentDirectory() + @"\Project\" + aProjectFile;

            string lProjPath = Path.GetDirectoryName(lProjectFile);

            // change dir to that project
            Directory.SetCurrentDirectory(lProjPath);
            string lproj = Directory.GetCurrentDirectory();

            if (lproj == "")
            {
                throw new Exception();
            }
            MSBuildApp.ExitType lExitType;
            try
            {
                // use MSBuild class found in MSBuild.EXE assembly
                lExitType = MSBuildApp.Execute("file " + lProjectFile + " " + aParams);
            }
            finally
            {
                Directory.SetCurrentDirectory(lBinDir);
            }
            // get the text of the MSBuild execution
            string s = lMyWriter.Text;

            // save it to a file in the folder
            using (StreamWriter lWriter = new StreamWriter(lBinDir + "\\MSBuild.log"))
                lWriter.Write(s);
            // check to see if there was any errors.
            if (aSuccessFullBuild)
            {
                if (lExitType != MSBuildApp.ExitType.Success)
                {
                    throw new Exception(s);
                }
            }
            return(s);
        }
コード例 #4
0
ファイル: Program.cs プロジェクト: Alexz18z35z/Gibbo2D
        static void Main(string[] args)
        {
            try
            {
                textWritter = new MyTextWriter();
                //Console.SetOut(textWritter);
                textWritter.ConsoleOutput += textWritter_ConsoleOutput;
                
                using (var game = new Game1())
                {
                    if (args.Length > 0)
                    {
                        Console.WriteLine("arg count: " + args.Length);

                        if (args.Length >= 2)
                        {
                            int px = int.Parse(args[0]);
                            int py = int.Parse(args[1]);
                            game.preferredPositionX = px;
                            game.preferredPositionY = py;
                        }

                        int cnt = 0;
                        foreach (var arg in args)
                        {
                            cnt++;
                            Console.WriteLine("ARG[" + cnt + "]: " + arg);
                        }
                    }

                    Gibbo.Library.SceneManager.GameArgs = args;

                    game.Run();
                }
            } 
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message, "error");
                Console.ReadLine();
            }

            //Console.WriteLine("DEBUG MODE, PRESS ANY KEY TO EXIT...");
            //Console.ReadLine();
        }
コード例 #5
0
ファイル: XUnitTestBase.cs プロジェクト: npolyak/NP.Roxy
        public XUnitTestBase(ITestOutputHelper testOutputHelper)
        {
            _myTextWriter = new MyTextWriter(testOutputHelper);

            Console.SetOut(_myTextWriter);
        }