Ejemplo n.º 1
0
        public static int Main(string[] args)
        {
            var arguments = new Arguments();

            if (!arguments.Parse(args))
            {
                Console.WriteLine("Parsing input arguments failed: " + arguments.ErrorMessage);
                Console.WriteLine(Arguments.Usage);
                return(-1);
                //throw new  Exception("Test runner execution failed");
            }
            try {
                var testCases = new TestCases();
                var xmlList   = testCases.FindXMLFiles(arguments.XmlFileDirectory);
                if (xmlList.Count > 0)
                {
                    foreach (var xmlfiles in xmlList)
                    {
                        testCases.ParseResultFile(xmlfiles);
                        FileInfo outputFile = new FileInfo(arguments.OutputDirectory.FullName + "\\ConsolidatedResults.csv");
                        if (!outputFile.Directory.Exists)
                        {
                            Directory.CreateDirectory(outputFile.DirectoryName);
                        }
                        testCases.WriteIntoCsv(outputFile.FullName);
                    }
                    int retVal = CheckOutputGenerated(arguments.OutputDirectory.FullName + "\\ConsolidatedResults.csv");
                    if (retVal == 0)
                    {
                        return(0);
                    }
                    else
                    {
                        return(1);
                    }
                }
                else
                {
                    Console.WriteLine("Couldnt Find The XML Files,Please Give The Correct Directory");
                    return(-1);
                }
            }
            catch (Exception e) {
                Console.WriteLine(e.Message);
                return(-1);
            }
        }
Ejemplo n.º 2
0
        public void TestThatWithValidArgumentsTheParsePasses()
        {
            bool returnValue = TestObject.Parse(validArguments);

            Assert.AreEqual(true, returnValue, "Expected different input");
        }