Inheritance: MyProcess
Beispiel #1
0
        public void ProcessToTest()
        {
            var Output = new LinkedList<string>();
            var mainProcess = new MainProcess();
            var f1 = new MyProcess1();
            var f2 = new MyProcess2();

            MyProcess.DrawedHandler OnDrawed = delegate(object sender, EventArgs e)
            {
                var de = ((DrawedEventArgs)e);
                //Console.WriteLine(Output);
                Output.AddLast(Convert.ToString(de.n));
            };

            f1.Drawed += new MyProcess.DrawedHandler(OnDrawed);
            f2.Drawed += new MyProcess.DrawedHandler(OnDrawed);
            while (mainProcess.State != State.Ended)
            {
                Output.AddLast("[");
                //Output.AddLast(String.Join(",", Process.allProcesses));
                mainProcess._ExecuteProcess();
                mainProcess._DrawProcess();
                //f1._ExecuteProcess();
                Process._removeOld();
                Output.AddLast("]");
            }
            Assert.AreEqual(
                "[,1,-1,],[,2,-2,],[,3,-3,],[,4,-4,],[,3,-3,],[,2,-2,],[,1,-1,],[,0,0,],[,-1,1,],[,-2,2,],[,-3,3,],[,-4,4,],[,-4,4,],[,]",
                String.Join(",", Output)
            );
            //Console.ReadKey();
        }
Beispiel #2
0
        public void ProcessToTest()
        {
            var Output      = new LinkedList <string>();
            var mainProcess = new MainProcess();
            var f1          = new MyProcess1();
            var f2          = new MyProcess2();

            MyProcess.DrawedHandler OnDrawed = delegate(object sender, EventArgs e)
            {
                var de = ((DrawedEventArgs)e);
                //Console.WriteLine(Output);
                Output.AddLast(Convert.ToString(de.n));
            };

            f1.Drawed += new MyProcess.DrawedHandler(OnDrawed);
            f2.Drawed += new MyProcess.DrawedHandler(OnDrawed);
            while (mainProcess.State != State.Ended)
            {
                Output.AddLast("[");
                //Output.AddLast(String.Join(",", Process.allProcesses));
                mainProcess._ExecuteProcess();
                mainProcess._DrawProcess();
                //f1._ExecuteProcess();
                Process._removeOld();
                Output.AddLast("]");
            }
            Assert.AreEqual(
                "[,1,-1,],[,2,-2,],[,3,-3,],[,4,-4,],[,3,-3,],[,2,-2,],[,1,-1,],[,0,0,],[,-1,1,],[,-2,2,],[,-3,3,],[,-4,4,],[,-4,4,],[,]",
                String.Join(",", Output)
                );
            //Console.ReadKey();
        }