Exemplo n.º 1
0
        static void RunEnabledTests()
        {
            using (_linqPad = new LinqPadAutomation(_linqPadPath, "Tx (LINQ to Traces)", "results"))
            {
                AutomationElementCollection groups = _linqPad.GetSampleGroups();

                foreach (AutomationElement group in groups)
                {
                    string groupName = group.GetName();
                    if (groupName == "HelloETW")
                    {
                        continue;
                    }

                    if (!IsGroupEnabled(groupName))
                    {
                        continue;
                    }

                    Console.ForegroundColor = ConsoleColor.White;
                    Console.WriteLine(groupName);
                    AutomationElementCollection queries = _linqPad.GetSamplesInGroup(group);

                    foreach (AutomationElement query in queries)
                    {
                        if (query.GetName() == "_Readme")
                        {
                            continue;
                        }

                        if (!IsTestEnabled(groupName, query.GetName()))
                        {
                            continue;
                        }

                        Console.ForegroundColor = ConsoleColor.White;
                        Console.Write("\t" + query.GetName() + "   ");

                        if (_linqPad.ExecuteQuery(group, query))
                        {
                            Console.ForegroundColor = ConsoleColor.Green;
                            Console.WriteLine("PASS");
                            _passCount++;
                        }
                        else
                        {
                            Console.ForegroundColor = ConsoleColor.Red;
                            Console.WriteLine("FAIL");
                            _failCount++;
                        }

                        Console.ForegroundColor = ConsoleColor.White;
                    }
                }
            }
        }
Exemplo n.º 2
0
        static void RunEnabledTests()
        {
            using (_linqPad = new LinqPadAutomation(_linqPadPath, "Tx (LINQ to Traces)", "results"))
            {
                AutomationElementCollection groups = _linqPad.GetSampleGroups();

                foreach (AutomationElement group in groups)
                {
                    string groupName = group.GetName();
                    if (groupName == "HelloETW")
                        continue;

                    if (!IsGroupEnabled(groupName))
                        continue;

                    Console.ForegroundColor = ConsoleColor.White;
                    Console.WriteLine(groupName);
                    AutomationElementCollection queries = _linqPad.GetSamplesInGroup(group);

                    foreach (AutomationElement query in queries)
                    {
                        if (query.GetName() == "_Readme")
                            continue;

                        if (!IsTestEnabled(groupName, query.GetName()))
                            continue;

                        Console.ForegroundColor = ConsoleColor.White;
                        Console.Write("\t" + query.GetName() + "   ");

                        if (_linqPad.ExecuteQuery(group, query))
                        {
                            Console.ForegroundColor = ConsoleColor.Green;
                            Console.WriteLine("PASS");
                            _passCount++;
                        }
                        else
                        {
                            Console.ForegroundColor = ConsoleColor.Red;
                            Console.WriteLine("FAIL");
                            _failCount++;
                        }

                        Console.ForegroundColor = ConsoleColor.White;
                    }
                }
            }
        }