< Summary

Class:Hotel
Assembly:Test
File(s):D:/--UnityProject/VR/subjects/UnityCityView/Assets/Scripts/Hotel.cs
Covered lines:6
Uncovered lines:15
Coverable lines:21
Total lines:40
Line coverage:28.5% (6 of 21)
Covered branches:0
Total branches:0
Covered methods:2
Total methods:5
Method coverage:40% (2 of 5)

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%
GetBuilding5Name()0%0000%

File(s)

D:/--UnityProject/VR/subjects/UnityCityView/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()
 15419    {
 20
 15421    }
 022  public void showlabel(){
 023    label.GetComponent<TextMeshPro>().text = GetLabel().Substring(0, 20);
 024  }
 25
 026  public string GetLabel(){
 027    string ret = "Hotel:";
 028    if(gameObject.name == "Building5"){
 029      ret = ret + GetBuilding5Name();
 030    }else{
 031      ret = ret + "Unknown Hotel";
 032    }
 033    return ret;
 034  }
 35
 036  string GetBuilding5Name(){
 037    return "Udon Hotel";
 038  }
 39
 40}