Example #1
0
        public static void Main(string[] args)
        {
            string pathToResourceFile = "..\\..\\resources\\resource.db";
            string pathToResultFile   = "..\\..\\result.db";

            Analizer      analizer = new Analizer(pathToResourceFile);
            ResultsWriter writer   = new ResultsWriter(pathToResultFile);

            writer.WriteResultToFile(analizer.GetIdentsFormattedString());
            writer.WriteResultToFile(analizer.GetConstantsFormattedString());
            writer.WriteResultToFile(analizer.GetOtherLexemsWordsFormattedString());
            writer.Finish();
        }
Example #2
0
        static void Main(string[] args)
        {
            FileValidator fileValidator = new FileValidator();
            List <Tuple <string, NodeConnection> > NodesConnectionsList = fileValidator.ReadFiles(args);

            Graph graph = new Graph(NodesConnectionsList, fileValidator.PointsOnMap, fileValidator.PointsToVisit, args[1]);

            PathOptimiser path_optimiser = new PathOptimiser();
            Tour          tour           = path_optimiser.OptimiseTour(graph, args[1], fileValidator.PointsToVisit, NodesConnectionsList);

            ResultsWriter results_writer = new ResultsWriter(tour);

            results_writer.PrintResultsToFile();
        }
 void ICallbacks.RunFinished(ITestResultAdaptor result)
 {
     try
     {
         var    resultWriter = new ResultsWriter();
         string xmlPath      = Path.Combine(Application.persistentDataPath, "TestResults.xml");
         string jsonPath     = Path.Combine(Application.persistentDataPath, "PerformanceTestResults.json");
         resultWriter.WriteResultToFile(result, xmlPath);
         var xmlParser = new TestResultXmlParser();
         var run       = xmlParser.GetPerformanceTestRunFromXml(xmlPath);
         File.WriteAllText(jsonPath, JsonUtility.ToJson(run, true));
     }
     catch (Exception e)
     {
         Console.WriteLine(e.Message + "\n" + e.InnerException);
     }
 }
Example #4
0
        /// <summary>
        /// The thread to run to create the board file.
        /// </summary>
        private void ProcessThread(DoWorkEventArgs e)
        {
            //open save dialog
            string filename = OpenSaveWindow();

            if (!string.IsNullOrEmpty(filename))
            {
                string validWords  = _projectModel.GameSetupModel.WordListsModel.ValidWords;
                string bannedWords = _projectModel.GameSetupModel.WordListsModel.BannedWords;

                ResultsWriter writer = new ResultsWriter();
                writer.CreateGeneratedFile(filename, validWords, bannedWords, _projectModel);
            }
            else
            {
                _processCanceled = true;
            }
        }
Example #5
0
        public void DummyTestOperation()
        {
            string currentExecutingMethod = Utilities.GetCurrentMethod();
            var    resultsWriter          = new ResultsWriter(Constants.ParameterizedTest, currentExecutingMethod, true);
            var    loginTestData          = DummyOperationData.GetTestData();

            Parallel.ForEach(WebDrivers, (driver, loopState) =>
            {
                var testAsserter = new TestCaseAsserts();
                string currentWebBrowserString = Utilities.GetWebBrowser(driver);

                if (loginTestData != null)
                {
                    ResultReport testResultReport = new ResultReport();
                    string testFixtureName        = Utilities.GenerateTestFixtureName(this.GetType(), currentExecutingMethod,
                                                                                      currentWebBrowserString);
                    testResultReport.StartMethodTimerAndInitiateCurrentTestCase(testFixtureName, true);
                    try
                    {
                        /*
                         * Call page flow respective method here.
                         */

                        /*
                         * Call necessary assertion from TestCaseAsserts class here.
                         */
                        testResultReport.SetCurrentTestCaseOutcome(true, testAsserter.AssertionCount.ToString());
                    }
                    catch (Exception e)
                    {
                        string screenShotIdentifier = String.Format("{0} - {1}", "{ENTER AN IDENTIFIER (E.G. USER NAME}", currentExecutingMethod);
                        base.HandleException(e, screenShotIdentifier, driver, testResultReport, testAsserter, resultsWriter);
                        Assert.Fail("***** DummyTest Failed *****");
                    }
                    finally
                    {
                        testResultReport.StopMethodTimerAndFinishCurrentTestCase();
                        base.TestCases.Add(testResultReport.currentTestCase);
                    }
                }
            });

            resultsWriter.WriteResultsToFile(this.GetType().Name, TestCases);
        }
Example #6
0
File: BLMngr.cs Project: abs508/jHc
        /// <summary>
        /// Print a full set of information if the folder exists.
        /// </summary>
        /// <param name="folder">folder to save to</param>
        public void PrintAll(string folder)
        {
            if (Directory.Exists(folder))
            {
                if (!ResultsWriter.WriteResultsTable(this.model, folder, this.logger))
                {
                    return;
                }

                if (!PointsTableWriter.SavePointsTable(this.model, folder, this.logger))
                {
                    return;
                }

                if (!MobTrophyTableWriter.WriteMobTrophyPointsTable(this.model, folder, this.eventData, this.logger))
                {
                    return;
                }

                if (!TeamTrophyTableWriter.Write(this.model, folder, this.eventData, this.logger))
                {
                    return;
                }

                if (!HandicapWriter.WriteHandicapTable(this.model, folder, this.normalisationConfigurationManager, this.logger))
                {
                    return;
                }

                if (!EventSummaryWriter.WriteEventSummaryTable(this.model, folder, this.logger))
                {
                    return;
                }

                if (!NextRunnerWriter.WriteNextRunnerTable(this.model, folder, this.seriesConfigurationManager, this.logger))
                {
                    return;
                }

                SetProgressInformation("Print completed successfully");
            }
        }
Example #7
0
 protected void HandleException(
     Exception ex,
     string screenshotIdentifier,
     IWebDriver webDriver,
     ResultReport resultReport,
     TestCaseAsserts asserts,
     ResultsWriter writer)
 {
     ScreenShotImage.CaptureScreenShot(
         webDriver,
         Utilities.CombineTestOutcomeString(Constants.ScreenshotError, screenshotIdentifier));
     resultReport.SetCurrentTestCaseOutcome(
         false,
         asserts.AssertionCount.ToString(),
         ex.Message,
         ex.StackTrace);
     resultReport.StopMethodTimerAndFinishCurrentTestCase();
     this.TestCases.Add(resultReport.currentTestCase);
     writer.WriteResultsToFile(this.GetType().Name, TestCases);
 }
Example #8
0
        private string writeResults()
        {
            var writer = new ResultsWriter(_context);
            var parser = new TestParser(_request.Test, writer, _library);

            parser.Parse();

            string results;

            try
            {
                results = writer.Document.ToString();
            }
            catch (HttpException)
            {
                results = @"Failed to create test run results because of bug in .NET Framework 4.0:
https://connect.microsoft.com/VisualStudio/feedback/details/578670/httputility-htmlencode-fails-in-application-start-with-response-is-not-available-in-this-context?wa=wsignin1.0";
            }
            return(results);
        }
        void ICallbacks.RunFinished(ITestResultAdaptor result)
        {
            PlayerCallbacks.saved = false;

            try
            {
                var resultWriter = new ResultsWriter();
                var xmlPath      = Path.Combine(Application.persistentDataPath, "TestResults.xml");
                var jsonPath     = Path.Combine(Application.persistentDataPath, "PerformanceTestResults.json");
                resultWriter.WriteResultToFile(result, xmlPath);
                var xmlParser = new TestResultXmlParser();
                var run       = xmlParser.GetPerformanceTestRunFromXml(xmlPath);
                if (run == null)
                {
                    return;
                }
                File.WriteAllText(jsonPath, JsonConvert.SerializeObject(run, Formatting.Indented));
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message + "\n" + e.InnerException);
            }
        }
Example #10
0
        public static void Main(string[] args)
        {
            string pathToResourceFile = "..\\..\\resources\\resource.db";
            string pathToResultFile   = "..\\..\\result.db";

            InstructionsTreatment treater = new InstructionsTreatment(pathToResourceFile);
            ResultsWriter         writer  = new ResultsWriter(pathToResultFile);

            while (true)
            {
                treater.SetNextLexemTypeToTreater();
                LexemsType type = treater.CurrentLexem;
                string     word = treater.CurrentWord;
                writer.WriteResultToFile(type, word);
                if (word.Trim() == "@")
                {
                    break;
                }
            }

            treater.Finish();
            writer.Finish();
        }