< Summary

Class:LightCandle
Assembly:Test
File(s):E:/Unity/Unity Project/VR-Room/Assets/_Course Library/Scripts/Test/LightCandle.cs
Covered lines:16
Uncovered lines:0
Coverable lines:16
Total lines:54
Line coverage:100% (16 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%000100%
OnCollisionEnter(...)0%000100%

File(s)

E:/Unity/Unity Project/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;
 434    public float velocityThreshold = 0.5f;
 35    void Start()
 236    {
 237        rigidbody = GetComponent<Rigidbody>();
 238    }
 39    void Update()
 557940    {
 557941        if (rigidbody.velocity.magnitude >= velocityThreshold)
 104042        {
 104043            flames.Stop();
 104044        }
 557945    }
 46    void OnCollisionEnter(Collision collision)
 647    {
 648        if (collision.gameObject.CompareTag("Player"))
 149        {
 150            flames.Play();
 151        }
 652    }
 53
 54}