< 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;
 59  public bool pointFlicker = true;
 10  public float clockSpeed;
 311    public int score { get; set; }
 12
 213  void Start() {
 214    StartCoroutine ("PlayTime");
 415    if (pointFlicker && secondsDCV == null) StartCoroutine ("PlayPointFlicker");
 216  }
 17
 218  public void SetReverseClock(bool setReverse){
 219    if (hoursDCV != null)
 220      hoursDCV.reverse = setReverse;
 221    if (minutesDCV != null)
 222      minutesDCV.reverse = setReverse;
 223    if (secondsDCV != null)
 024      secondsDCV.reverse = setReverse;
 225  }
 26
 227  IEnumerator PlayTime(){
 628    while (true) {
 329      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      }
 341      else {
 342        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  }
 252  IEnumerator PlayPointFlicker(){
 23653    while (pointFlicker) {
 11854      yield return new WaitForSeconds (1.0f /clockSpeed);
 11655      pointsDCV.ChangeTimeValue ();
 11656    }
 057  }
 58}