< Summary

Class:TrafficLights
Assembly:Assembly-CSharp
File(s):E:/Unity/Unity Project/wheelchair-sim/Assets/Scripts/Test/TrafficLights.cs
Covered lines:9
Uncovered lines:9
Coverable lines:18
Total lines:42
Line coverage:50% (9 of 18)
Covered branches:0
Total branches:0
Covered methods:2
Total methods:2
Method coverage:100% (2 of 2)

Coverage History

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
Start()0%00043.75%
Update()0%000100%

File(s)

E:/Unity/Unity Project/wheelchair-sim/Assets/Scripts/Test/TrafficLights.cs

#LineLine coverage
 1using System.Collections;
 2using System.Collections.Generic;
 3using UnityEngine;
 4
 5public class TrafficLights : MonoBehaviour
 6{
 7    public Light Red;
 8    public Light Green;
 9    public Light Yellow;
 10
 11
 12
 13    // Start is called before the first frame update
 14    IEnumerator Start()
 115    {
 116        Yellow.enabled = false;
 17
 118        while (true)
 119        {
 120            Green.enabled = true;
 121            Red.enabled = false;
 122            yield return new WaitForSeconds(30);
 023            Debug.Log("on");
 024            Yellow.enabled = true;
 025            Green.enabled = false;
 026            yield return new WaitForSeconds(5);
 027            Debug.Log("on");
 028            Red.enabled = true;
 029            Yellow.enabled = false;
 030            yield return new WaitForSeconds(30);
 31
 032        }
 33
 34    }
 35
 36
 37    // Update is called once per frame
 38    void Update()
 22339    {
 40
 22341    }
 42}

Methods/Properties

Start()
Update()