< Summary

Class:Government
Assembly:Test
File(s):D:/--UnityProject/VR/subjects/UnityCityView/Assets/Scripts/Government.cs
Covered lines:6
Uncovered lines:25
Coverable lines:31
Total lines:52
Line coverage:19.3% (6 of 31)
Covered branches:0
Total branches:0
Covered methods:2
Total methods:7
Method coverage:28.5% (2 of 7)

Coverage History

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
Start()0%000100%
Update()0%000100%
showlabel()0%0000%
GetLabel()0%0000%
GetBuilding8Name()0%0000%
GetBuilding9Name()0%0000%
GetBuilding91Name()0%0000%

File(s)

D:/--UnityProject/VR/subjects/UnityCityView/Assets/Scripts/Government.cs

#LineLine coverage
 1using System.Collections;
 2using System.Collections.Generic;
 3using UnityEngine;
 4using TMPro;
 5
 6public class Government : MonoBehaviour
 7{
 8    // Start is called before the first frame update
 9  GameObject label;
 10
 11    void Start()
 312    {
 313        GameObject player = GameObject.Find("Player");
 314    label = player.transform.GetChild(1).gameObject;
 315    }
 16
 17    // Update is called once per frame
 18    void Update()
 46219    {
 20
 46221    }
 022  public void showlabel(){
 023    label.GetComponent<TextMeshPro>().text = GetLabel().Substring(0, 20);
 024  }
 25
 026  string GetLabel(){
 027    string ret = "Government:";
 028    if(gameObject.name == "Building8"){
 029      ret = ret + GetBuilding8Name();
 030    }else if(gameObject.name == "Building9"){
 031      ret = ret + GetBuilding9Name();
 032    }else if(gameObject.name == "Building91"){
 033      ret = ret + GetBuilding91Name();
 034    }else{
 035      ret = ret + "Unknown Department";
 036    }
 037    return ret;
 038  }
 39
 040  string GetBuilding8Name(){
 041    return "Town Hall";
 042  }
 43
 044  string GetBuilding9Name(){
 045    return "Police Department";
 046  }
 47
 048  string GetBuilding91Name(){
 049    return "Financial Department";
 050  }
 51
 52}