< Summary

Class:Hotel
Assembly:Test
File(s):D:/--UnityProject/VR/subjects1_for_analysis/UnityCityView-master/UnityCityView-master/Assets/Scripts/Hotel.cs
Covered lines:18
Uncovered lines:3
Coverable lines:21
Total lines:40
Line coverage:85.7% (18 of 21)
Covered branches:0
Total branches:0
Covered methods:5
Total methods:5
Method coverage:100% (5 of 5)

Coverage History

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
Start()0%000100%
Update()0%000100%
showlabel()0%00066.67%
GetLabel()0%00072.73%
GetBuilding5Name()0%000100%

File(s)

D:/--UnityProject/VR/subjects1_for_analysis/UnityCityView-master/UnityCityView-master/Assets/Scripts/Hotel.cs

#LineLine coverage
 1using System.Collections;
 2using System.Collections.Generic;
 3using UnityEngine;
 4using TMPro;
 5
 6public class Hotel : MonoBehaviour
 7{
 8    // Start is called before the first frame update
 9  GameObject label;
 10
 11    void Start()
 112    {
 113        GameObject player = GameObject.Find("Player");
 114    label = player.transform.GetChild(1).gameObject;
 115    }
 16
 17    // Update is called once per frame
 18    void Update()
 249019    {
 20
 249021    }
 122  public void showlabel(){
 123    label.GetComponent<TextMeshPro>().text = GetLabel().Substring(0, 20);
 024  }
 25
 226  public string GetLabel(){
 227    string ret = "Hotel:";
 428    if(gameObject.name == "Building5"){
 229      ret = ret + GetBuilding5Name();
 230    }else{
 031      ret = ret + "Unknown Hotel";
 032    }
 233    return ret;
 234  }
 35
 236  string GetBuilding5Name(){
 237    return "Udon Hotel";
 238  }
 39
 40}