< Summary

Class:DigitalClockValue
Assembly:Test
File(s):E:/Unity/Unity Project/EscapeTheRoomVR/Assets/Test 1/DigitalClockValue.cs
Covered lines:21
Uncovered lines:8
Coverable lines:29
Total lines:46
Line coverage:72.4% (21 of 29)
Covered branches:0
Total branches:0
Covered methods:3
Total methods:3
Method coverage:100% (3 of 3)

Coverage History

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
DigitalClockValue()0%000100%
ChangeToTargetTime(...)0%00070%
ChangeTimeValue()0%00070%

File(s)

E:/Unity/Unity Project/EscapeTheRoomVR/Assets/Test 1/DigitalClockValue.cs

#LineLine coverage
 1using UnityEngine;
 2using System.Collections;
 3
 4//[ExecuteInEditMode]
 5public class DigitalClockValue : MonoBehaviour {
 6  public int currentValue;
 7  private int lastValue;
 8  public int maximumValue;
 9  public DigitalClockValue NextValue;
 10  public DisplaySelectedObject tens;
 11  public DisplaySelectedObject units;
 612  public int tensValue=10;
 613  public bool reverse=false;
 14
 215  public void ChangeToTargetTime(int value){
 216    if (!reverse)
 217      currentValue = value-1;
 18    else
 019      currentValue = value+1;
 220    if (value > maximumValue)
 021      value = maximumValue - 1;
 222    if (value < 0)
 023      value = 0;
 224    ChangeTimeValue ();
 225  }
 26
 22527  public void ChangeTimeValue(){
 22528    if (!reverse)
 22529      currentValue += 1;
 30    else
 031      currentValue -= 1;
 28432    if (currentValue > maximumValue - 1) {
 5933      currentValue = 0;
 5934      if (NextValue != null)
 135        NextValue.ChangeTimeValue ();
 5936    }
 22537    if (currentValue < 0) {
 038      currentValue = maximumValue - 1;
 039      if (NextValue != null)
 040        NextValue.ChangeTimeValue ();
 041    }
 42
 33743    if (tens!=null)tens.TurnSelectedWithButton (currentValue/tensValue);
 22544    units.TurnSelectedWithButton (currentValue % tensValue);
 22545  }
 46}