< Summary

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

Coverage History

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
Start()0%000100%
Update()0%000100%
showlabel()0%000100%
GetLabel()0%00084.21%
GetBuilding6Name()0%000100%
GetBuilding61Name()0%000100%
GetBuilding7Name()0%000100%

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()
 6903919    {
 20
 6903921    }
 622  public void showlabel(){
 623    label.GetComponent<TextMeshPro>().text = GetLabel().Substring(0, 20);
 624  }
 25
 626  string GetLabel(){
 627    string ret = "Commercial:";
 828    if(gameObject.name == "Building6"){
 229      ret = ret + GetBuilding6Name();
 830    }else if(gameObject.name == "Building61"){
 231      ret = ret + GetBuilding61Name();
 632    }else if(gameObject.name == "Building7"){
 233      ret = ret + GetBuilding7Name();
 234    }else{
 035      ret = ret + "Unknown Commercial";
 036    }
 637    return ret;
 638  }
 39
 240  string GetBuilding6Name(){
 241    return "Pokemon Shopping Center";
 242  }
 43
 244  string GetBuilding61Name(){
 245    return "Kaiseki Restaurant";
 246  }
 47
 248  string GetBuilding7Name(){
 249    return "Totoro Theater";
 250  }
 51
 52}