< Summary

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

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;
 234    public float velocityThreshold = 0.5f;
 35    void Start()
 136    {
 137        rigidbody = GetComponent<Rigidbody>();
 138    }
 39    void Update()
 923740    {
 923741        if (rigidbody.velocity.magnitude >= velocityThreshold)
 22142        {
 22143            flames.Stop();
 22144        }
 923745    }
 46    void OnCollisionEnter(Collision collision)
 3047    {
 3048        if (collision.gameObject.CompareTag("Player"))
 049        {
 050            flames.Play();
 051        }
 3052    }
 53
 54}