Revert UnitTest IP address to 127.0.0.1.

Seems there are sometimes performance regressions when using localhost. Might be related to IPv6, who know.

Fix some TestContext not being public.
This commit is contained in:
Serge Camille
2020-09-13 10:28:06 +02:00
parent 023530322e
commit 8f3c701a2f
3 changed files with 4 additions and 3 deletions

View File

@@ -13,7 +13,7 @@ namespace S7.Net.UnitTest
[TestClass]
public class ProtocolUnitTest
{
private TestContext TestContext { get; set; }
public TestContext TestContext { get; set; }
[TestMethod]
public async Task TPKT_Read()

View File

@@ -38,6 +38,7 @@ namespace S7.Net.UnitTest
const int DB2 = 2;
const int DB4 = 4;
const short TestServerPort = 31122;
const string TestServerIp = "127.0.0.1";
#endregion
#region Private fields
@@ -56,7 +57,7 @@ namespace S7.Net.UnitTest
private static Plc CreatePlc()
{
return new Plc(CpuType.S7300, "localhost", TestServerPort, 0, 2);
return new Plc(CpuType.S7300, TestServerIp, TestServerPort, 0, 2);
}
[TestInitialize]

View File

@@ -65,7 +65,7 @@ namespace S7.Net.UnitTest
[TestClass]
public class StreamTests
{
private TestContext TestContext { get; set; }
public TestContext TestContext { get; set; }
[TestMethod]
public async Task TPKT_ReadRestrictedStreamAsync()