< Summary

Class:KeyPadControll
Assembly:Test
File(s):D:/--UnityProject/VR/VRExplorer_subjects/Edutainment-Escape-Room/Assets/Scripts/Test/Keypad/KeyPadControll.cs
Covered lines:6
Uncovered lines:11
Coverable lines:17
Total lines:41
Line coverage:35.2% (6 of 17)
Covered branches:0
Total branches:0
Covered methods:3
Total methods:4
Method coverage:75% (3 of 4)

Coverage History

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
KeyPadControll()0%000100%
Start()0%000100%
Update()0%00042.86%
CheckIfCorrect(...)0%0000%

File(s)

D:/--UnityProject/VR/VRExplorer_subjects/Edutainment-Escape-Room/Assets/Scripts/Test/Keypad/KeyPadControll.cs

#LineLine coverage
 1using System.Collections;
 2using System.Collections.Generic;
 3using UnityEngine;
 4using UnityEngine.Events;
 5
 6public class KeyPadControll : MonoBehaviour
 7{
 8    public int correctCombination;
 89    public bool accessGranted = false;
 10
 11    //public GameObject key;
 12
 13    public UnityEvent onCorrectCode;
 14
 15
 16    // Start is called before the first frame update
 17    private void Start()
 418    {
 19        //key.SetActive(false);
 420    }
 21
 22    // Update is called once per frame
 23    void Update()
 982024    {
 982025        if(accessGranted == true)
 026        {
 027            onCorrectCode.Invoke();
 028            accessGranted = false;
 029        }
 982030    }
 31
 32    public bool CheckIfCorrect(int combination)
 033    {
 034        if(combination == correctCombination)
 035        {
 036            accessGranted = true;
 037            return true;
 38        }
 039        return false;
 040    }
 41}