< Summary

Class:Lightable
Assembly:Test
File(s):D:/--UnityProject/VR/_____ISSTA 26/EscapeTheRoomVR/Assets/Test 1/Lightable.cs
Covered lines:14
Uncovered lines:0
Coverable lines:14
Total lines:28
Line coverage:100% (14 of 14)
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
Start()0%000100%
ToggleLight()0%000100%

File(s)

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

#LineLine coverage
 1using System.Collections;
 2using System.Collections.Generic;
 3using UnityEngine;
 4
 5public class Lightable : MonoBehaviour {
 34276    public bool on { get; private set; }
 7
 8    // Lightable game objects are off by default at start
 29  public void Start() {
 210        on = false;
 211    gameObject.GetComponentInChildren<Light>().enabled = false;
 212  }
 13
 314  public void ToggleLight() {
 15        // Toggle light switch
 316        on = !on;
 317    gameObject.GetComponentInChildren<Light> ().enabled =
 18      !gameObject.GetComponentInChildren<Light> ().enabled;
 19    // Change message based on light switch position
 520        if (on) {
 221      gameObject.GetComponent<Inspectable>().inspectMessage = "That's much better...";
 322    } else {
 123      gameObject.GetComponent<Inspectable>().inspectMessage = "Hello darkness, my old friend...";
 124    }
 25
 26
 327  }
 28}