< Summary

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

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%
GetBuilding1Name()0%0000%
GetBuilding2Name()0%0000%
GetBuilding3Name()0%0000%
GetBuilding4Name()0%0000%
GetBuilding41Name()0%0000%
GetBuilding42Name()0%0000%

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()
 92418    {
 19
 92420    }
 21
 022  public void showlabel(){
 023    label.GetComponent<TextMeshPro>().text = GetLabel().Substring(0, 20);
 024  }
 25
 026  string GetLabel(){
 027    string ret = "Residential:";
 028    if(gameObject.name == "Building1"){
 029      ret = ret + GetBuilding1Name();
 030    }else if(gameObject.name == "Building2"){
 031      ret = ret + GetBuilding2Name();
 032    }else if(gameObject.name == "Building3"){
 033      ret = ret + GetBuilding3Name();
 034    }else if(gameObject.name == "Building4"){
 035      ret = ret + GetBuilding4Name();
 036    }else if(gameObject.name == "Building41"){
 037      ret = ret + GetBuilding41Name();
 038    }else if(gameObject.name == "Building42"){
 039      ret = ret + GetBuilding42Name();
 040    }else{
 041      ret = ret + "Unknown Apartment";
 042    }
 043    return ret;
 044  }
 45
 046  string GetBuilding1Name(){
 047    return "Saru Apartment";
 048  }
 49
 050  string GetBuilding2Name(){
 051    return "Usagi Apartment";
 052  }
 53
 054  string GetBuilding3Name(){
 055    return "Kumo Apartment";
 056  }
 57
 058  string GetBuilding4Name(){
 059    return "Neko Apartment";
 060  }
 61
 062  string GetBuilding41Name(){
 063    return "Inu Apartment";
 064  }
 65
 066  string GetBuilding42Name(){
 067    return "Tora Apartment";
 068  }
 69}