< Summary

Class:DigitalClock
Assembly:Test
File(s):D:/--UnityProject/VR/_____ISSTA 26/EscapeTheRoomVR/Assets/Test 1/DigitalClock.cs
Covered lines:30
Uncovered lines:12
Coverable lines:42
Total lines:58
Line coverage:71.4% (30 of 42)
Covered branches:0
Total branches:0
Covered methods:7
Total methods:7
Method coverage:100% (7 of 7)

Coverage History

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
DigitalClock()0%000100%
Start()0%000100%
SetReverseClock(...)0%00087.5%
PlayTime()0%00052%
PlayPointFlicker()0%00085.71%

File(s)

D:/--UnityProject/VR/_____ISSTA 26/EscapeTheRoomVR/Assets/Test 1/DigitalClock.cs

#LineLine coverage
 1using UnityEngine;
 2using System.Collections;
 3
 4public class DigitalClock : MonoBehaviour {
 5  public DigitalClockValue hoursDCV;
 6  public DigitalClockValue minutesDCV;
 7  public DigitalClockValue secondsDCV;
 8  public DigitalClockValue pointsDCV;
 29  public bool pointFlicker = true;
 10  public float clockSpeed;
 511    public int score { get; set; }
 12
 113  void Start() {
 114    StartCoroutine ("PlayTime");
 215    if (pointFlicker && secondsDCV == null) StartCoroutine ("PlayPointFlicker");
 116  }
 17
 118  public void SetReverseClock(bool setReverse){
 119    if (hoursDCV != null)
 120      hoursDCV.reverse = setReverse;
 121    if (minutesDCV != null)
 122      minutesDCV.reverse = setReverse;
 123    if (secondsDCV != null)
 024      secondsDCV.reverse = setReverse;
 125  }
 26
 127  IEnumerator PlayTime(){
 428    while (true) {
 229      if (secondsDCV!=null){
 030        yield return new WaitForSeconds (1.0f /clockSpeed);
 031        secondsDCV.ChangeTimeValue();
 032        if (pointFlicker) {
 033          pointsDCV.ChangeTimeValue ();
 034                    int hours = hoursDCV.currentValue,
 035                        minutes = minutesDCV.currentValue;
 036          GameObject.FindGameObjectWithTag("clock").GetComponent<Inspectable> ().inspectMessage =
 37                        string.Format ("It reads {0:D2}:{1:D2}.", hours, minutes);
 038                    score = (hours * 60) + minutes;
 039        }
 040      }
 241      else {
 242        yield return new WaitForSeconds (60.0f/clockSpeed);
 143                minutesDCV.ChangeTimeValue ();
 144                int hours = hoursDCV.currentValue,
 145                minutes = minutesDCV.currentValue;
 146                GameObject.FindGameObjectWithTag ("clock").GetComponent<Inspectable> ().inspectMessage =
 47                    string.Format ("It reads {0:D2}:{1:D2}.", hours, minutes);
 148                score = (hours * 60) + minutes;
 149      }
 150    }
 51  }
 152  IEnumerator PlayPointFlicker(){
 22853    while (pointFlicker) {
 11454      yield return new WaitForSeconds (1.0f /clockSpeed);
 11355      pointsDCV.ChangeTimeValue ();
 11356    }
 057  }
 58}