public void TestSetup() { SetupGood(); Assert.AreEqual(masterNodeApiGood.host, goodHost); var ex = Assert.Throws <Exception>(() => masterNodeApiGood.SetNetworkInfo(null)); Assert.That(ex.Message, Is.EqualTo("networkInfo cannot be null")); }
void SetupBad() { calledBack = false; GameObject gameObject = new GameObject(); gameObject.AddComponent <MasterNodeApi>(); masterNodeApiBad = gameObject.GetComponent <MasterNodeApi>(); masterNodeApiBad.SetNetworkInfo(badNetwork); }