public void PingDisplayTextLabelNullReferencesUpdateTest() { NetworkPingDisplay pingDisplay = CreateMonoBehaviour <NetworkPingDisplay>(); pingDisplay.Client = client; Assert.Throws <NullReferenceException>(() => { pingDisplay.Update(); }); }
public void PingDisplayTextLabelNullReferencesUpdateTest() { var gameObject = new GameObject("pingDisplay", typeof(NetworkPingDisplay)); NetworkPingDisplay pingDisplay = gameObject.GetComponent <NetworkPingDisplay>(); pingDisplay.Client = client; Assert.Throws <NullReferenceException>(() => { pingDisplay.Update(); }); }
public void PingDisplayTextChangedValue() { var gameObject = new GameObject("pingDisplay", typeof(NetworkPingDisplay), typeof(Text)); NetworkPingDisplay pingDisplay = gameObject.GetComponent <NetworkPingDisplay>(); pingDisplay.Client = client; pingDisplay.NetworkPingLabelText = gameObject.GetComponent <Text>(); Text oldValue = pingDisplay.NetworkPingLabelText; pingDisplay.Update(); Assert.That(oldValue != pingDisplay.NetworkPingLabelText, Is.False); }