Created new test for client connection failed

This commit is contained in:
Federico Barresi
2019-12-27 10:09:28 +01:00
parent c6611a74c3
commit f23bf78b34

View File

@@ -0,0 +1,29 @@
using System;
using System.Linq;
using Shouldly;
using Xunit;
namespace Sharp7.Tests
{
public class ClientWithoutServer
{
private S7Client client;
public ClientWithoutServer()
{
client = new S7Client();
}
public new void Dispose()
{
client.Disconnect();
}
[Fact]
public void CannotConnectTest()
{
var rc = client.ConnectTo("127.0.1.2", 0, 2);
rc.ShouldBe(Sharp7.S7Consts.errTCPConnectionFailed);
}
}
}