< Summary

Class:Commercial
Assembly:Test
File(s):D:/--UnityProject/VR/subjects/UnityCityView/Assets/Scripts/Commercial.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%
GetBuilding6Name()0%0000%
GetBuilding61Name()0%0000%
GetBuilding7Name()0%0000%

File(s)

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

#LineLine coverage
 1using System.Collections;
 2using System.Collections.Generic;
 3using UnityEngine;
 4using TMPro;
 5
 6public class Commercial : 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 = "Commercial:";
 028    if(gameObject.name == "Building6"){
 029      ret = ret + GetBuilding6Name();
 030    }else if(gameObject.name == "Building61"){
 031      ret = ret + GetBuilding61Name();
 032    }else if(gameObject.name == "Building7"){
 033      ret = ret + GetBuilding7Name();
 034    }else{
 035      ret = ret + "Unknown Commercial";
 036    }
 037    return ret;
 038  }
 39
 040  string GetBuilding6Name(){
 041    return "Pokemon Shopping Center";
 042  }
 43
 044  string GetBuilding61Name(){
 045    return "Kaiseki Restaurant";
 046  }
 47
 048  string GetBuilding7Name(){
 049    return "Totoro Theater";
 050  }
 51
 52}