< Summary

Class:KeyPadControll
Assembly:Test
File(s):D:/--UnityProject/VR/VRExplorer_subjects/Edutainment-Escape-Room/Assets/Scripts/Test/Keypad/KeyPadControll.cs
Covered lines:10
Uncovered lines:7
Coverable lines:17
Total lines:41
Line coverage:58.8% (10 of 17)
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
KeyPadControll()0%000100%
Start()0%000100%
Update()0%00042.86%
CheckIfCorrect(...)0%00057.14%

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;
 169    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()
 1418    {
 19        //key.SetActive(false);
 1420    }
 21
 22    // Update is called once per frame
 23    void Update()
 5280424    {
 5280425        if(accessGranted == true)
 026        {
 027            onCorrectCode.Invoke();
 028            accessGranted = false;
 029        }
 5280430    }
 31
 32    public bool CheckIfCorrect(int combination)
 333    {
 334        if(combination == correctCombination)
 035        {
 036            accessGranted = true;
 037            return true;
 38        }
 339        return false;
 340    }
 41}