< Summary

Class:Clock
Assembly:Test
File(s):D:/--UnityProject/VR/VRExplorer_subjects/Edutainment-Escape-Room/Assets/Scripts/Test/Time/Clock.cs
Covered lines:21
Uncovered lines:6
Coverable lines:27
Total lines:54
Line coverage:77.7% (21 of 27)
Covered branches:0
Total branches:0
Covered methods:5
Total methods:6
Method coverage:83.3% (5 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%000100%
onTimeOut()0%0000%

File(s)

D:/--UnityProject/VR/VRExplorer_subjects/Edutainment-Escape-Room/Assets/Scripts/Test/Time/Clock.cs

#LineLine coverage
 1using System.Collections;
 2using System.Collections.Generic;
 3using UnityEngine;
 4using UnityEngine.UI;
 5using TMPro;
 6
 7public class Clock : MonoBehaviour
 8{
 109    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()
 719    {
 720        finished = false;
 721    }
 22    // Update is called once per frame
 23    void Update()
 2640224    {
 2640225        if (!finished)
 2330126        {
 2330127            time += Time.deltaTime;
 2330128            TimeDisplay(time);
 2330129        }
 2640230    }
 31
 32    void TimeDisplay(float timeToDisplay)
 2330133    {
 2330134        if (timeToDisplay < 0)
 035        {
 036            timeToDisplay = 0;
 037        }
 38
 2330139        float minutes = Mathf.FloorToInt(timeToDisplay / 60);
 2330140        float seconds = Mathf.FloorToInt(timeToDisplay % 60);
 2330141        clockText.text = string.Format("{0:00}:{1:00}", minutes, seconds);
 2330142    }
 43
 44    public void onFinish()
 345    {
 346        BestTime.checkTime(time);
 347        finished = true;
 348    }
 49
 50    public void onTimeOut()
 051    {
 052        finished = true;
 053    }
 54}