< Summary

Class:TimerHandler
Assembly:Test
File(s):D:/--UnityProject/VR/VRExplorer_subjects/EscapeGameVR/Assets/Scripts/Test/TImer/TimerHandler.cs
Covered lines:20
Uncovered lines:16
Coverable lines:36
Total lines:59
Line coverage:55.5% (20 of 36)
Covered branches:0
Total branches:0
Covered methods:2
Total methods:7
Method coverage:28.5% (2 of 7)

Coverage History

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
TimerHandler()0%000100%
Update()0%000100%
PauseTimer()0%0000%
ResumeTimer()0%0000%
ResetTimer()0%0000%
SaveTime()0%0000%
GetTime()0%0000%

File(s)

D:/--UnityProject/VR/VRExplorer_subjects/EscapeGameVR/Assets/Scripts/Test/TImer/TimerHandler.cs

#LineLine coverage
 1using System.Collections;
 2using System.Collections.Generic;
 3using TMPro;
 4using UnityEngine;
 5
 6public class TimerHandler : MonoBehaviour
 7{
 298    private float currentTime = 0;
 299    private int currentSeconds = 0;
 2910    private int heures = 0;
 2911    private int minutes = 0;
 2912    private int seconds = 0;
 2913    private bool isRunning = true;
 14    [SerializeField] private TextMeshProUGUI display;
 15    [SerializeField] private SavedTime timeSaved;
 16
 17    // Update is called once per frame
 18    private void Update()
 888819    {
 888820        if (isRunning)
 888821        {
 888822            currentTime += Time.deltaTime;
 888823            currentSeconds = Mathf.FloorToInt(currentTime % 60);
 888824            if (currentSeconds != seconds)  //Si une seconde s'est �coul� depuis la derni�re mise � jour du texte, mettr
 123525            {
 123526                seconds = currentSeconds;
 123527                heures = Mathf.FloorToInt(currentSeconds / 3600);
 123528                minutes = Mathf.FloorToInt((currentTime % 3600) / 60);
 123529                display.text = $"{heures:d2}:{minutes:d2}:{seconds:d2}";
 123530            }
 888831        }
 888832    }
 33
 34    public void PauseTimer()
 035    {
 036        isRunning = false;
 037    }
 38
 39    public void ResumeTimer()
 040    {
 041        isRunning = true;
 042    }
 43
 44    public void ResetTimer()
 045    {
 046        currentTime = 0;
 047        isRunning = true;
 048    }
 49
 50    public void SaveTime()
 051    {
 052        timeSaved.time = currentTime;
 053    }
 54
 55    public string GetTime()
 056    {
 057        return display.text;
 058    }
 59}