Beispiel #1
0
        protected void TestBench_TestCompleted(object sender, TorqueTestEventArgs e)
        {
            if (e.Test != null)
            {
                if (e.Test.ShouldBeSaved && Session != null)
                {
                    if (e.Test is UnidirectionalTorqueTest)
                    {
                        // make the control appear which the user can use
                        // to enter the torque test id.
                        IsTestIdNeeded = true;

                        DisplayTempMessage(Messages.ScanBarcodeMessage(), GOOD_MESSAGE_BRUSH, 0);
                    }
                    else
                    {
                        // here is the spot that we check if actual test results fall within a
                        // certain limit of the calibrated item.
                        TestResultAnalyzer testAnalyst = new TestResultAnalyzer();
                        string             testResult;
                        if (testAnalyst.CannotAcceptResults(e.Test, Session.WorkId, out testResult))
                        {
                            // set these quick, so they will return to these after the
                            // temporary test result error message.
                            Instructions           = Business.Shared.Messages.StartButtonMessage();
                            MessageBackgroundColor = GOOD_MESSAGE_BRUSH;

                            DisplayTempMessage(testResult, TEST_FAILURE_BRUSH, 30);
                            e.Test.ShouldBeSaved = false;

                            // get ready to start another test.
                            ClearPointsFromChart();
                        }
                        else
                        {
                            // make the control appear which the user can use
                            // to enter the torque test id.
                            IsTestIdNeeded = true;

                            DisplayTempMessage(Messages.ScanBarcodeMessage(), GOOD_MESSAGE_BRUSH, 0);
                        }
                    }
                }
            }
            else
            {
                DisplayTempMessage(Messages.StartButtonMessage(), GOOD_MESSAGE_BRUSH, 0);
                DisplayTempMessage(Messages.TestCancelledMessage(), ERROR_BRUSH, 3);

                ClearPointsFromChart();
                // start a new test, the user cancelled the current one.
            }

            // order is important, do Stop THEN Start
            StopTestCommand.RaiseCanExecuteChanged();
            StartTestCommand.RaiseCanExecuteChanged();
            ExitProgamCommand.RaiseCanExecuteChanged();
            EditTestSettingsCommand.RaiseCanExecuteChanged();
        }
        public void AnalyzeEntireFile()
        {
            TestResultAnalyzer analyzer = new TestResultAnalyzer(loader.TopLevelResult);

            analyzer.FindFixtures(loader.TopLevelResult);
            analyzer.Analyze();

            Assert.AreEqual(this.FixtureCount, analyzer.Children.Count);

            Assert.AreEqual(this.TestCount, analyzer.TestCount);
            Assert.AreEqual(this.FailureCount, analyzer.FailureCount);
            Assert.AreEqual(this.NotRunCount, analyzer.NotRunCount);
            Assert.AreEqual(this.InconclusiveCount, analyzer.InconclusiveCount);
        }
        public void AnalyzeEntireFile()
        {
            TestResultAnalyzer analyzer = new TestResultAnalyzer(loader.TopLevelResult);

            analyzer.FindFixtures(loader.TopLevelResult);
            analyzer.Analyze();

            Assert.AreEqual(this.FixtureCount, analyzer.Children.Count);

            Assert.AreEqual(this.TestCount, analyzer.TestCount);
            Assert.AreEqual(this.FailureCount, analyzer.FailureCount);
            Assert.AreEqual(this.NotRunCount, analyzer.NotRunCount);
            Assert.AreEqual(this.InconclusiveCount, analyzer.InconclusiveCount);
        }
        public void AnalyzeEachProject()
        {
            foreach (ProjectInfo project in Projects)
            {
                TestResult         result   = loader.FindProjectResult(project.Name);
                TestResultAnalyzer analyzer = new TestResultAnalyzer(result);

                analyzer.FindFixtures(result);
                analyzer.Analyze();

                Assert.AreEqual(project.FixtureCount, analyzer.Children.Count, project.Name);

                Assert.AreEqual(project.TestCount, analyzer.TestCount, project.Name);
                Assert.AreEqual(project.FailureCount, analyzer.FailureCount, project.Name);
                Assert.AreEqual(project.NotRunCount, analyzer.NotRunCount, project.Name);
                Assert.AreEqual(project.InconclusiveCount, analyzer.InconclusiveCount, project.Name);
            }
        }
        public void AnalyzeEachProject()
        {
            foreach (ProjectInfo project in Projects)
            {
                TestResult result = loader.FindProjectResult(project.Name);
                TestResultAnalyzer analyzer = new TestResultAnalyzer(result);

                analyzer.FindFixtures(result);
                analyzer.Analyze();

                Assert.AreEqual(project.FixtureCount, analyzer.Children.Count, project.Name);

                Assert.AreEqual(project.TestCount, analyzer.TestCount, project.Name);
                Assert.AreEqual(project.FailureCount, analyzer.FailureCount, project.Name);
                Assert.AreEqual(project.NotRunCount, analyzer.NotRunCount, project.Name);
                Assert.AreEqual(project.InconclusiveCount, analyzer.InconclusiveCount, project.Name);
            }
        }
        public void AnalyzeEntireFileByProject()
        {
            TestResultAnalyzer topLevel = new TestResultAnalyzer("Top Level");

            int fixtureCount = 0;

            foreach (TestResult result in loader.ProjectResults)
            {
                TestResultAnalyzer analyzer = new TestResultAnalyzer(result);
                analyzer.FindFixtures(result);
                topLevel.Children.Add(analyzer);
                fixtureCount += analyzer.Children.Count;
            }

            topLevel.Analyze();

            Assert.AreEqual(Projects.Length, topLevel.Children.Count);
            Assert.AreEqual(FixtureCount, fixtureCount);

            Assert.AreEqual(TestCount, topLevel.TestCount);
            Assert.AreEqual(FailureCount, topLevel.FailureCount);
            Assert.AreEqual(NotRunCount, topLevel.NotRunCount);
            Assert.AreEqual(InconclusiveCount, topLevel.InconclusiveCount);
        }
        public void AnalyzeEntireFileByProject()
        {
            TestResultAnalyzer topLevel = new TestResultAnalyzer("Top Level");

            int fixtureCount = 0;
            foreach (TestResult result in loader.ProjectResults)
            {
                TestResultAnalyzer analyzer = new TestResultAnalyzer(result);
                analyzer.FindFixtures(result);
                topLevel.Children.Add(analyzer);
                fixtureCount += analyzer.Children.Count;
            }

            topLevel.Analyze();

            Assert.AreEqual(Projects.Length, topLevel.Children.Count);
            Assert.AreEqual(FixtureCount, fixtureCount);

            Assert.AreEqual(TestCount, topLevel.TestCount);
            Assert.AreEqual(FailureCount, topLevel.FailureCount);
            Assert.AreEqual(NotRunCount, topLevel.NotRunCount);
            Assert.AreEqual(InconclusiveCount, topLevel.InconclusiveCount);
        }