mirror of
https://github.com/fbarresi/Sharp7.git
synced 2026-02-04 16:42:53 +00:00
Created new test for client connection failed
This commit is contained in:
29
Sharp7.Tests/ClientWithoutServer.cs
Normal file
29
Sharp7.Tests/ClientWithoutServer.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user