< Summary

Class:Residential
Assembly:Test
File(s):D:/--UnityProject/VR/subjects/UnityCityView/Assets/Scripts/Residential.cs
Covered lines:44
Uncovered lines:2
Coverable lines:46
Total lines:69
Line coverage:95.6% (44 of 46)
Covered branches:0
Total branches:0
Covered methods:10
Total methods:10
Method coverage:100% (10 of 10)

Coverage History

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
Start()0%000100%
Update()0%000100%
showlabel()0%000100%
GetLabel()0%00090.32%
GetBuilding1Name()0%000100%
GetBuilding2Name()0%000100%
GetBuilding3Name()0%000100%
GetBuilding4Name()0%000100%
GetBuilding41Name()0%000100%
GetBuilding42Name()0%000100%

File(s)

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

#LineLine coverage
 1using System.Collections;
 2using System.Collections.Generic;
 3using UnityEngine;
 4using TMPro;
 5
 6public class Residential : MonoBehaviour
 7{
 8    // Start is called before the first frame update
 9  GameObject label;
 10    void Start()
 611    {
 612        GameObject player = GameObject.Find("Player");
 613    label = player.transform.GetChild(1).gameObject;
 614    }
 15
 16    // Update is called once per frame
 17    void Update()
 2089218    {
 19
 2089220    }
 21
 1222  public void showlabel(){
 1223    label.GetComponent<TextMeshPro>().text = GetLabel().Substring(0, 20);
 1224  }
 25
 1226  string GetLabel(){
 1227    string ret = "Residential:";
 1428    if(gameObject.name == "Building1"){
 229      ret = ret + GetBuilding1Name();
 1430    }else if(gameObject.name == "Building2"){
 231      ret = ret + GetBuilding2Name();
 1232    }else if(gameObject.name == "Building3"){
 233      ret = ret + GetBuilding3Name();
 1034    }else if(gameObject.name == "Building4"){
 235      ret = ret + GetBuilding4Name();
 836    }else if(gameObject.name == "Building41"){
 237      ret = ret + GetBuilding41Name();
 638    }else if(gameObject.name == "Building42"){
 239      ret = ret + GetBuilding42Name();
 240    }else{
 041      ret = ret + "Unknown Apartment";
 042    }
 1243    return ret;
 1244  }
 45
 246  string GetBuilding1Name(){
 247    return "Saru Apartment";
 248  }
 49
 250  string GetBuilding2Name(){
 251    return "Usagi Apartment";
 252  }
 53
 254  string GetBuilding3Name(){
 255    return "Kumo Apartment";
 256  }
 57
 258  string GetBuilding4Name(){
 259    return "Neko Apartment";
 260  }
 61
 262  string GetBuilding41Name(){
 263    return "Inu Apartment";
 264  }
 65
 266  string GetBuilding42Name(){
 267    return "Tora Apartment";
 268  }
 69}