Exemple #1
0
        static void Test <TTester>() where
        TTester : ISelfTestAndShowResults, new()
        {
            var tester = new TTester();
            var rs     = tester.TestAndShowResults();

            foreach (var r in rs)
            {
                Console.WriteLine(r);
            }
        }
Exemple #2
0
        static void Debug <TTester, T>() where
        TTester : BaseSelfTester <T>, new()
            where T : ITestee, new()
        {
            var tester = new TTester();
            var rs     = tester.Test(tester.Testee);
            var c      = 0;

            foreach (var r in rs)
            {
                if (!r.Passed)
                {
                    var ar = (int[])r.TestSet.Input[0];
                    var l  = ar.Length;
                    Console.WriteLine($"Test {++c} failed, length {l}, expected{r.TestSet.ExpectedOutput}, actual {r.Actual}");
                }
            }
        }