コード例 #1
0
        public SummaryViewModel()
        {
            _testPackage             = new TestPackage();
            RunTestsCommand          = new Command(_ => _ = ExecuteTestsAync(), _ => !Running);
            ViewFailedResultsCommand = new Command(
                _ => Navigation.PushAsync(new ResultsView(new ResultsViewModel(_summary.GetTestResults(), false))),
                _ => !HasResults);

            ExploreTestsCommand = new Command(_ => _ = ExploreTestsAsync(), _ => !Running);
        }
コード例 #2
0
        public SummaryViewModel()
        {
            ExportStatus             = "Not Exported";
            _testPackage             = new TestPackage();
            RunTestsCommand          = new Command(_ => ExecuteTestsAsync(), _ => !Running);
            ViewFailedResultsCommand = new Command(
                _ => Navigation.PushAsync(new ResultsView(new ResultsViewModel(_summary.GetTestResults(), false))),
                _ => !HasResults);

            ExploreTestsCommand  = new Command(_ => ExploreTestsAsync(), _ => !Running);
            ExportTestResultsXML = new Command(OnExportResultXml);
        }
コード例 #3
0
        public ResultReporter(ResultSummary summary, ColorConsoleWriter writer, CommandLineOptions options)
        {
            _writer  = writer;
            _options = options;

            Summary = summary;

            TestResults = Summary.GetTestResults();

            _result = TestResults.FirstNode as XElement;

            _overallResult = Summary.Result;
            if (_overallResult == "Skipped")
            {
                _overallResult = "Warning";
            }
        }
コード例 #4
0
        public void OneTimeSetUp()
        {
            string testResultsFile = Path.Combine(TestContext.CurrentContext.TestDirectory, "MockTestResult.xml");

            using (var reader = new StreamReader(testResultsFile))
                _testResults = XDocument.Load(reader);

            _testRun    = _testResults.Element("test-run");
            _testSuites = _testRun.Elements("test-suite");

            _summary = new ResultSummary();
            foreach (var element in _testSuites)
            {
                _summary.AddResult(element);
            }

            _summaryResults = _summary.GetTestResults();
            _summaryTestRun = _summaryResults.Element("test-run");
        }
コード例 #5
0
        public void OneTimeSetUp()
        {
            string testDirectory   = Path.GetDirectoryName(typeof(ResultSummaryTests).GetTypeInfo().Assembly.Location);
            string testResultsFile = Path.Combine(testDirectory, "MockTestResult.xml");

            using (var stream = new FileStream(testResultsFile, FileMode.Open))
                using (var reader = new StreamReader(stream))
                    _testResults = XDocument.Load(reader);

            _testRun    = _testResults.Element("test-run");
            _testSuites = _testRun.Elements("test-suite");

            _summary = new ResultSummary();
            foreach (var element in _testSuites)
            {
                _summary.AddResult(element);
            }

            _summaryResults = _summary.GetTestResults();
            _summaryTestRun = _summaryResults.Element("test-run");
        }
コード例 #6
0
 public SummaryViewModel()
 {
     _testPackage          = new TestPackage();
     RunTestsCommand       = new Command(async o => await ExecuteTestsAync(), o => !Running);
     ViewAllResultsCommand = new Command(
         async o => await Navigation.PushAsync(new ResultsView(new ResultsViewModel(_results.GetTestResults(), true))),
         o => !HasResults);
     ViewFailedResultsCommand = new Command(
         async o => await Navigation.PushAsync(new ResultsView(new ResultsViewModel(_results.GetTestResults(), false))),
         o => !HasResults);
 }