public virtual void TestCreateWithPort() { // see if the ephemeral port is updated WebApp app = WebApps.$for(this).At(0).Start(); int port = app.GetListenerAddress().Port; NUnit.Framework.Assert.IsTrue(port > 0); app.Stop(); // try to reuse the port app = WebApps.$for(this).At(port).Start(); NUnit.Framework.Assert.AreEqual(port, app.GetListenerAddress().Port); app.Stop(); }
public virtual void TestCreateWithNonZeroPort() { WebApp app = WebApps.$for(this).At(50000).Start(); int port = app.GetListenerAddress().Port; NUnit.Framework.Assert.AreEqual(50000, port); // start another WebApp with same NonZero port WebApp app2 = WebApps.$for(this).At(50000).Start(); // An exception occurs (findPort disabled) app.Stop(); app2.Stop(); }