< Summary

Class:CheckElements
Assembly:Test
File(s):D:/--UnityProject/VR/VRExplorer_projects_dataset/Parkinson-App-Virtual-Reality/Assets/Scripts/Test/CheckElements.cs
Covered lines:21
Uncovered lines:0
Coverable lines:21
Total lines:49
Line coverage:100% (21 of 21)
Covered branches:0
Total branches:0
Covered methods:4
Total methods:4
Method coverage:100% (4 of 4)

Coverage History

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
CheckElements()0%000100%
Start()0%000100%
AddElementInSocket()0%000100%
CheckNumberOfElements()0%000100%

File(s)

D:/--UnityProject/VR/VRExplorer_projects_dataset/Parkinson-App-Virtual-Reality/Assets/Scripts/Test/CheckElements.cs

#LineLine coverage
 1using System;
 2using System.Collections;
 3using System.Collections.Generic;
 4using UnityEngine;
 5using UnityEngine.Events;
 6
 7public class CheckElements : MonoBehaviour
 8{
 9    [SerializeField] private int numberOfElements; //3
 910    private int numberOfElementsInSocket = 0;
 11
 912    [SerializeField] bool cursorActive = true;
 13
 14    [Header("Unity Events")]
 15    public UnityEvent unlock;
 16    public UnityEvent hideTaskDescription;
 17    public UnityEvent showNextLevelUI;
 18
 19    [Header("UI Components")]
 20    [SerializeField] Canvas nextLevelUI;
 21    [SerializeField] Canvas taskDescription;
 22
 23
 24    private void Start()
 825    {
 826        if (cursorActive)
 827        {
 828            Cursor.lockState = CursorLockMode.Locked;
 829            Cursor.visible = false;
 830        }
 831    }
 32
 33
 34    public void AddElementInSocket()
 1235    {
 1236        numberOfElementsInSocket++;
 1237        CheckNumberOfElements();
 1238    }
 39
 40    private void CheckNumberOfElements()
 1241    {
 1242        if (numberOfElementsInSocket == numberOfElements)
 243        {
 244            hideTaskDescription.Invoke();
 245            showNextLevelUI.Invoke();
 246            unlock.Invoke();
 247        }
 1248    }
 49}