Esempio n. 1
0
        public void Test_Constructor()
        {
            var algo = new TestAlgo(1);
            var output = GetOutput();

            var ilalgo = WeaverHelper.CreateInstance<Yalf.TestAssembly.TestAlgo>(assembly, 1);
            var iloutput = GetOutput();

            var equal = String.Compare(output, iloutput, StringComparison.OrdinalIgnoreCase) == 0;
            Assert.That(equal, Is.True);
        }
Esempio n. 2
0
        public void Test_EvenOdd()
        {
            var algo = new TestAlgo();

            algo.EvenOdd(5);

            var context = Log.DumpInMemory();

            var output = LogPrinter.Print(context);

            Console.WriteLine(output);
        }
Esempio n. 3
0
        public void Test_CrossThreadException()
        {
            try
            {
                var algo = new TestAlgo();
                algo.SpinAThreadForWithException();
            }
            catch
            {
            }

            var context = Log.DumpInMemory();

            var output = LogPrinter.Print(context);

            Console.WriteLine(output);
        }
Esempio n. 4
0
        public void Test_Record_Binary_Display()
        {
            var algo = new TestAlgo();

            try
            {
                algo.WithException();
            }
            catch
            {
            }

            var data = Log.DumpToBinary();

            var context = Log.DumpFromBinary(data);

            var output = LogPrinter.Print(context);

            Console.WriteLine(output);
        }
Esempio n. 5
0
        public void Test_Exception()
        {
            var algo = new TestAlgo();
            bool exception = false;

            try
            {
                algo.WithException();
            }
            catch
            {
                exception = true;
            }

            Assert.IsTrue(exception);

            var context = Log.DumpInMemory();

            var output = LogPrinter.Print(context);

            Console.WriteLine(output);
        }
Esempio n. 6
0
 private void RunException()
 {
     var algo = new TestAlgo();
     algo.WithException();
 }
Esempio n. 7
0
 private void RunEvenOdd()
 {
     var depth = Thread.CurrentThread.ManagedThreadId;
     var algo = new TestAlgo();
     algo.EvenOdd(depth);
 }
Esempio n. 8
0
        public void Test_Recursive_Enabled()
        {
            var algo = new TestAlgo();

            algo.Recursive(10);

            var context = Log.DumpInMemory();

            var output = LogPrinter.Print(context);

            Console.WriteLine(output);
        }
Esempio n. 9
0
        public void Test_Exception()
        {
            var algo = new TestAlgo();
            bool exception = false;
            try
            {
                algo.WithException();
            }
            catch
            {
                exception = true;
            }
            var output = GetOutput();

            var ilalgo = WeaverHelper.CreateInstance<Yalf.TestAssembly.TestAlgo>(assembly);
            bool ilexception = false;
            try
            {
                ilalgo.WithException();
            }
            catch
            {
                ilexception = true;
            }
            var iloutput = GetOutput();

            Assert.That(exception, Is.True);
            Assert.That(ilexception, Is.True);

            var equal = String.Compare(output, iloutput, StringComparison.OrdinalIgnoreCase) == 0;
            Assert.That(equal, Is.True);
        }
Esempio n. 10
0
        public void Test_Recursive_Enabled()
        {
            var algo = new TestAlgo();
            algo.Recursive(10);
            var output = GetOutput();

            var ilalgo = WeaverHelper.CreateInstance<Yalf.TestAssembly.TestAlgo>(assembly);
            ilalgo.Recursive(10);
            var iloutput = GetOutput();

            var equal = String.Compare(output, iloutput, StringComparison.OrdinalIgnoreCase) == 0;
            Assert.That(equal, Is.True);
        }