예제 #1
0
        private static GroupData RunTest(Type t)
        {
            GroupData data = new GroupData();

            data.List = new List <TimeSpan>();

            TestCaseAttribute a = t.GetCustomAttribute <TestCaseAttribute>();

            data.Group = a.Description;

            RunTest(t, x => data.List.Add(x));

            return(data);
        }
예제 #2
0
        private static void ShowMenu(Type[] testTypes)
        {
            Console.WriteLine("测试菜单:");
            Console.WriteLine("===================================");
            Console.WriteLine("x---结束测试");
            Console.WriteLine("0---重新显示菜单");

            int i = 1;

            foreach (Type t in testTypes)
            {
                TestCaseAttribute a = t.GetCustomAttribute <TestCaseAttribute>();

                string text = string.Format("{0}---{1}", i++, a.Description);
                Console.WriteLine(text);
            }
            Console.WriteLine("5---运行所有测试");
        }