< Summary

Class:LightCandle
Assembly:Test
File(s):D:/--UnityProject/VR/_____ISSTA 26/VR-Room/Assets/_Course Library/Scripts/Test/LightCandle.cs
Covered lines:10
Uncovered lines:6
Coverable lines:16
Total lines:54
Line coverage:62.5% (10 of 16)
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
LightCandle()0%000100%
Start()0%000100%
Update()0%00050%
OnCollisionEnter(...)0%00050%

File(s)

D:/--UnityProject/VR/_____ISSTA 26/VR-Room/Assets/_Course Library/Scripts/Test/LightCandle.cs

#LineLine coverage
 1using BNG;
 2using System.Diagnostics.CodeAnalysis;
 3using UnityEngine;
 4using HenryLab;
 5
 6public class LightCandle : MonoBehaviour, IGrabbableEntity
 7{
 8    [ExcludeFromCodeCoverage]
 9    public Grabbable Grabbable
 10    {
 11        get
 12        {
 13            var g = GetComponent<Grabbable>();
 14            if (g) return g;
 15            return gameObject.AddComponent<Grabbable>();
 16        }
 17    }
 18    [ExcludeFromCodeCoverage] public string Name => Str.Grabbable;
 19
 20    [ExcludeFromCodeCoverage] public Transform Destination => null;
 21
 22
 23    [ExcludeFromCodeCoverage]
 24    public void OnGrabbed()
 25    {
 26    }
 27
 28    [ExcludeFromCodeCoverage]
 29    public void OnReleased()
 30    {
 31    }
 32    public ParticleSystem flames;
 33    private Rigidbody rigidbody;
 234    public float velocityThreshold = 0.5f;
 35    void Start()
 136    {
 137        rigidbody = GetComponent<Rigidbody>();
 138    }
 39    void Update()
 451840    {
 451841        if (rigidbody.velocity.magnitude >= velocityThreshold)
 042        {
 043            flames.Stop();
 044        }
 451845    }
 46    void OnCollisionEnter(Collision collision)
 1847    {
 1848        if (collision.gameObject.CompareTag("Player"))
 049        {
 050            flames.Play();
 051        }
 1852    }
 53
 54}