< Summary

Class:MovePillow
Assembly:Test
File(s):D:/--UnityProject/VR/_____ISSTA 26/EscapeTheRoomVR/Assets/Test 1/MovePillow.cs
Covered lines:30
Uncovered lines:0
Coverable lines:30
Total lines:43
Line coverage:100% (30 of 30)
Covered branches:0
Total branches:0
Covered methods:6
Total methods:6
Method coverage:100% (6 of 6)

Coverage History

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
MovePillow()0%000100%
Start()0%000100%
Update()0%000100%
SetInteractable(...)0%000100%
SetKey(...)0%000100%
MovePillowAway()0%000100%

File(s)

D:/--UnityProject/VR/_____ISSTA 26/EscapeTheRoomVR/Assets/Test 1/MovePillow.cs

#LineLine coverage
 1using System.Collections;
 2using System.Collections.Generic;
 3using UnityEngine;
 4
 5public class MovePillow : MonoBehaviour {
 26    public Lightable[] lamps = new Lightable[2];
 7    public GameObject key; // Hack to hide key
 28    bool isMoved = false;
 9
 110    void Start() {
 111        GetComponent<Inspectable>().enabled = false;
 112        GetComponent<Collectable>().enabled = false;
 113        GetComponent<Collider>().enabled = false;
 114        key.GetComponent<Collider>().enabled = false;
 115    }
 16
 744917    void Update() {
 839218        if (!isMoved && (lamps[0].on || lamps[1].on)) {
 94319            SetInteractable (true);
 744920        } else {
 650621            SetInteractable (false);
 650622        }
 744923    }
 24
 744925    public void SetInteractable(bool status) {
 744926        GetComponent<Inspectable>().enabled = status;
 744927        GetComponent<Collectable>().enabled = status;
 744928        GetComponent<Collider>().enabled = status;
 744929    }
 30
 331    void SetKey(bool status) {
 632        if (key != null) {
 333            key.GetComponent<Collider> ().enabled = status;
 334        }
 335    }
 36
 37    // Move pillow aside to reveal the hidden key
 338    public void MovePillowAway() {
 339        transform.Translate(0.5f, 0, 0);
 340        isMoved = true;
 341        SetKey (true);
 342    }
 43}