diff --git a/README.md b/README.md index a6e990a..81ce33b 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,5 @@ PM> Install-Package S7netplus ## Running the tests -Unit tests use Snap7 server, so port 102 must be not in use. -If you have Siemens Step7 installed, the service s7oiehsx64 is stopped when running unit tests. -You have to restart the service manually if you need it. +Unit tests use Snap7 server. +On Windows, the DLL is included with the test project. On other platforms, Snap7 must be installed manually before running tests. diff --git a/S7.Net.UnitTest/S7.Net.UnitTest.csproj b/S7.Net.UnitTest/S7.Net.UnitTest.csproj index abbf6c5..e836b62 100644 --- a/S7.Net.UnitTest/S7.Net.UnitTest.csproj +++ b/S7.Net.UnitTest/S7.Net.UnitTest.csproj @@ -25,10 +25,6 @@ - - - - PreserveNewest diff --git a/S7.Net.UnitTest/S7NetTestsAsync.cs b/S7.Net.UnitTest/S7NetTestsAsync.cs index d317533..f90f250 100644 --- a/S7.Net.UnitTest/S7NetTestsAsync.cs +++ b/S7.Net.UnitTest/S7NetTestsAsync.cs @@ -1,17 +1,11 @@ #region Using using System; using System.Collections.Generic; -using System.Linq; using Microsoft.VisualStudio.TestTools.UnitTesting; -using S7.Net; using S7.Net.UnitTest.Helpers; -using S7.Net.UnitTest; using S7.Net.Types; using S7.UnitTest.Helpers; using System.Threading.Tasks; -#if NETFRAMEWORK -using System.ServiceProcess; -#endif using System.Threading; #endregion diff --git a/S7.Net.UnitTest/S7NetTestsSync.cs b/S7.Net.UnitTest/S7NetTestsSync.cs index 8d713a5..0ad4efa 100644 --- a/S7.Net.UnitTest/S7NetTestsSync.cs +++ b/S7.Net.UnitTest/S7NetTestsSync.cs @@ -1,16 +1,10 @@ #region Using using System; using System.Collections.Generic; -using System.Linq; using Microsoft.VisualStudio.TestTools.UnitTesting; -using S7.Net; using S7.Net.UnitTest.Helpers; -using S7.Net.UnitTest; using S7.Net.Types; using S7.UnitTest.Helpers; -#if NETFRAMEWORK -using System.ServiceProcess; -#endif #endregion @@ -57,8 +51,6 @@ namespace S7.Net.UnitTest public S7NetTests() { plc = CreatePlc(); - //ConsoleManager.Show(); - ShutDownServiceS7oiehsx64(); } @@ -1034,20 +1026,6 @@ namespace S7.Net.UnitTest #endregion #region Private methods - private static void ShutDownServiceS7oiehsx64() - { -#if NETFRAMEWORK - ServiceController[] services = ServiceController.GetServices(); - var service = services.FirstOrDefault(s => s.ServiceName == "s7oiehsx64"); - if (service != null) - { - if (service.Status == ServiceControllerStatus.Running) - { - service.Stop(); - } - } -#endif - } #region IDisposable Support private bool disposedValue = false; // To detect redundant calls