Class: DecisionAgent::Testing::CoverageReport

Inherits:
Object
  • Object
show all
Defined in:
lib/decision_agent/testing/test_coverage_analyzer.rb

Overview

Coverage report for test scenarios

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(total_rules:, covered_rules:, untested_rules:, coverage_percentage:, rule_coverage:, condition_coverage:) ⇒ CoverageReport

Returns a new instance of CoverageReport.



11
12
13
14
15
16
17
18
19
20
# File 'lib/decision_agent/testing/test_coverage_analyzer.rb', line 11

def initialize(total_rules:, covered_rules:, untested_rules:, coverage_percentage:, rule_coverage:, condition_coverage:)
  @total_rules = total_rules
  @covered_rules = covered_rules
  @untested_rules = untested_rules.freeze
  @coverage_percentage = coverage_percentage
  @rule_coverage = rule_coverage.freeze
  @condition_coverage = condition_coverage.freeze

  freeze
end

Instance Attribute Details

#condition_coverageObject (readonly)

Returns the value of attribute condition_coverage.



9
10
11
# File 'lib/decision_agent/testing/test_coverage_analyzer.rb', line 9

def condition_coverage
  @condition_coverage
end

#coverage_percentageObject (readonly)

Returns the value of attribute coverage_percentage.



9
10
11
# File 'lib/decision_agent/testing/test_coverage_analyzer.rb', line 9

def coverage_percentage
  @coverage_percentage
end

#covered_rulesObject (readonly)

Returns the value of attribute covered_rules.



9
10
11
# File 'lib/decision_agent/testing/test_coverage_analyzer.rb', line 9

def covered_rules
  @covered_rules
end

#rule_coverageObject (readonly)

Returns the value of attribute rule_coverage.



9
10
11
# File 'lib/decision_agent/testing/test_coverage_analyzer.rb', line 9

def rule_coverage
  @rule_coverage
end

#total_rulesObject (readonly)

Returns the value of attribute total_rules.



9
10
11
# File 'lib/decision_agent/testing/test_coverage_analyzer.rb', line 9

def total_rules
  @total_rules
end

#untested_rulesObject (readonly)

Returns the value of attribute untested_rules.



9
10
11
# File 'lib/decision_agent/testing/test_coverage_analyzer.rb', line 9

def untested_rules
  @untested_rules
end

Instance Method Details

#to_hObject



22
23
24
25
26
27
28
29
30
31
# File 'lib/decision_agent/testing/test_coverage_analyzer.rb', line 22

def to_h
  {
    total_rules: @total_rules,
    covered_rules: @covered_rules,
    untested_rules: @untested_rules,
    coverage_percentage: @coverage_percentage,
    rule_coverage: @rule_coverage,
    condition_coverage: @condition_coverage
  }
end