/// <summary> /// Assert that the result of /// <see cref="HttpServer2.ToString()"/> /// contains the specific text /// </summary> /// <param name="server">server to examine</param> /// <param name="text">text to search for</param> private void AssertToStringContains(HttpServer2 server, string text) { string description = server.ToString(); Assert.True("Did not find \"" + text + "\" in \"" + description + "\"", description.Contains(text)); }
public virtual void TestMissingServerResource() { try { HttpServer2 server = CreateServer("NoSuchWebapp"); //should not have got here. //close the server string serverDescription = server.ToString(); Stop(server); NUnit.Framework.Assert.Fail("Expected an exception, got " + serverDescription); } catch (FileNotFoundException expected) { log.Debug("Expected exception " + expected, expected); } }