Exemplo n.º 1
0
 public void GivenAnalysisResults()
 {
     var rule = new DelayRule();
     var testCase = TestHelper.FindTestCase<IntegerCalculatorTest>(t => t.TestAddTwoAsserts());
     var app = new TestCaseRuleApplication(testCase, rule, new ViolationScorer());
     _results = new AnalysisResults(Enumerable.Repeat(app, 1), new[] { testCase });
 }
        public void GivenAnApplicationOfARuleToAnInappropriateTestCase()
        {
            var tc = TestHelper.FindTestCase<IntegerCalculatorTest>(t => t.TestAddTwoAsserts());
            var rule = new LimitAssertsPerTestCaseRule();
            var scorer = Substitute.For<IViolationScorer>();
            scorer.CalculateScore(Arg.Any<Violation>()).Returns(1);

            _app = new TestCaseRuleApplication(tc, rule, scorer);
        }
Exemplo n.º 3
0
 public ReportApplication(TestCaseRuleApplication app)
 {
     RuleName = app.Rule.ToString();
     TimeMs = app.ElapsedTimeInMilliseconds;
     TestCaseName = app.TestCase.Name;
     Violations = app.Violations.Select(v => new ReportViolation(v)).ToList();
     Score = app.Score;
 }