< Summary

Class:Clock
Assembly:Assembly-CSharp
File(s):D:/--UnityProject/VR/_____ISSTA 26/Edutainment-Escape-Room/Assets/Scripts/Test2/Clock.cs
Covered lines:22
Uncovered lines:5
Coverable lines:27
Total lines:54
Line coverage:81.4% (22 of 27)
Covered branches:0
Total branches:0
Covered methods:6
Total methods:6
Method coverage:100% (6 of 6)

Coverage History

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
Clock()0%000100%
Start()0%000100%
Update()0%000100%
TimeDisplay(...)0%00066.67%
onFinish()0%00050%
onTimeOut()0%000100%

File(s)

D:/--UnityProject/VR/_____ISSTA 26/Edutainment-Escape-Room/Assets/Scripts/Test2/Clock.cs

#LineLine coverage
 1using System.Collections;
 2using System.Collections.Generic;
 3using UnityEngine;
 4using UnityEngine.UI;
 5using TMPro;
 6
 7public class Clock : MonoBehaviour
 8{
 49    public float time = 0;
 10    public TextMeshPro clockText;
 11
 12    public BestTime BestTime;
 13
 14    public GameObject test;
 15
 16    public bool finished;
 17
 18    private void Start()
 119    {
 120        finished = false;
 121    }
 22    // Update is called once per frame
 23    void Update()
 10324    {
 10325        if (!finished)
 9826        {
 9827            time += Time.deltaTime;
 9828            TimeDisplay(time);
 9829        }
 10330    }
 31
 32    void TimeDisplay(float timeToDisplay)
 9833    {
 9834        if (timeToDisplay < 0)
 035        {
 036            timeToDisplay = 0;
 037        }
 38
 9839        float minutes = Mathf.FloorToInt(timeToDisplay / 60);
 9840        float seconds = Mathf.FloorToInt(timeToDisplay % 60);
 9841        clockText.text = string.Format("{0:00}:{1:00}", minutes, seconds);
 9842    }
 43
 44    public void onFinish()
 145    {
 146        BestTime.checkTime(time);
 047        finished = true;
 048    }
 49
 50    public void onTimeOut()
 151    {
 152        finished = true;
 153    }
 54}