< Summary

Class:DigitalClock
Assembly:Test
File(s):D:/--UnityProject/VR/_____ISSTA 26/EscapeTheRoomVR/Assets/Test 1/DigitalClock.cs
Covered lines:23
Uncovered lines:19
Coverable lines:42
Total lines:58
Line coverage:54.7% (23 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%00024%
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;
 211    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(){
 228    while (true) {
 129      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      }
 141      else {
 142        yield return new WaitForSeconds (60.0f/clockSpeed);
 043                minutesDCV.ChangeTimeValue ();
 044                int hours = hoursDCV.currentValue,
 045                minutes = minutesDCV.currentValue;
 046                GameObject.FindGameObjectWithTag ("clock").GetComponent<Inspectable> ().inspectMessage =
 47                    string.Format ("It reads {0:D2}:{1:D2}.", hours, minutes);
 048                score = (hours * 60) + minutes;
 049      }
 050    }
 51  }
 152  IEnumerator PlayPointFlicker(){
 10853    while (pointFlicker) {
 5454      yield return new WaitForSeconds (1.0f /clockSpeed);
 5355      pointsDCV.ChangeTimeValue ();
 5356    }
 057  }
 58}