< Summary

Class:CheckElements
Assembly:Test
File(s):E:/Unity/Unity Project/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)

E:/Unity/Unity Project/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
 410    private int numberOfElementsInSocket = 0;
 11
 412    [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()
 225    {
 226        if (cursorActive)
 227        {
 228            Cursor.lockState = CursorLockMode.Locked;
 229            Cursor.visible = false;
 230        }
 231    }
 32
 33
 34    public void AddElementInSocket()
 1235    {
 1236        numberOfElementsInSocket++;
 1237        CheckNumberOfElements();
 1238    }
 39
 40    private void CheckNumberOfElements()
 1241    {
 1242        if (numberOfElementsInSocket == numberOfElements)
 143        {
 144            hideTaskDescription.Invoke();
 145            showNextLevelUI.Invoke();
 146            unlock.Invoke();
 147        }
 1248    }
 49}