Skip to content

Commit 9b1015a

Browse files
committed
Updated tests and documentation with default ports
1 parent abfdf1e commit 9b1015a

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

documentation/README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2526,9 +2526,8 @@ MyWebApi.Server().Stops();
25262526
You can test over the full pipeline by providing OWIN start up class and optional network host and post. You can start global HTTP server in your test/class/assembly initialize method and set test cases with different requests or just instantiate separate server for each test:
25272527

25282528
```c#
2529-
// starts OWIN web server with the provided host and port. If such are not provided, default is "http://localhost:1234"
2529+
// starts OWIN web server with the provided host and port. If such are not provided, default is "http://localhost:80"
25302530
// * the server is disposed after the test
2531-
// * some hosts and ports may require administrator rights
25322531
// * HTTP request can be set just like in the controller unit tests
25332532
// * HTTP response can be tested just like in the controller unit tests
25342533
MyWebApi
@@ -2544,7 +2543,7 @@ MyWebApi
25442543
// starts OWIN server with specific
25452544
// for the test Startup class
25462545
// * the server is disposed after the test
2547-
// * since host and port are not provided, the default "http://localhost:1234" is used
2546+
// * since host and port are not provided, the default "http://localhost:80" is used
25482547
MyWebApi
25492548
.Server()
25502549
.Working<Startup>() // working will instantiate new OWIN server with the specified Startup class

src/MyWebApi.Tests/BuildersTests/ServersTests/ServerTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public void StartsAndStopsShouldWorkCorrectlyForOwinServers()
8080
Assert.IsNotNull(OwinTestServer.GlobalClient);
8181
Assert.IsTrue(OwinTestServer.GlobalIsStarted);
8282

83-
Assert.AreEqual("http://localhost:1234", OwinTestServer.GlobalClient.BaseAddress.OriginalString);
83+
Assert.AreEqual("http://localhost:80", OwinTestServer.GlobalClient.BaseAddress.OriginalString);
8484

8585
MyWebApi.Server().Stops();
8686

@@ -118,7 +118,7 @@ public void StartWithCustomHostShouldWorkCorrectly()
118118
{
119119
MyWebApi.Server().Starts<CustomStartup>(host: "https://localhost");
120120

121-
Assert.AreEqual("https://localhost:1234", OwinTestServer.GlobalClient.BaseAddress.OriginalString);
121+
Assert.AreEqual("https://localhost:80", OwinTestServer.GlobalClient.BaseAddress.OriginalString);
122122

123123
MyWebApi.Server().Stops();
124124
}

0 commit comments

Comments
 (0)