diff --git a/.github/workflows/build-pull.yml b/.github/workflows/build-pull.yml
new file mode 100644
index 00000000..6d611ee3
--- /dev/null
+++ b/.github/workflows/build-pull.yml
@@ -0,0 +1,26 @@
+name: .NET Pull Request
+
+on:
+ pull_request:
+ branches: [ master ]
+
+jobs:
+ build:
+
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v4
+ - name: Fetch history
+ run: git fetch --prune --unshallow
+ - name: Setup .NET
+ uses: actions/setup-dotnet@v4
+ with:
+ dotnet-version: |
+ 5.0.x
+ 6.0.x
+ 8.0.x
+ - name: Restore dependencies
+ run: dotnet restore DotNetSiemensPLCToolBoxLibrary.sln
+ - name: Build
+ run: dotnet build DotNetSiemensPLCToolBoxLibrary.sln
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
new file mode 100644
index 00000000..169f3f44
--- /dev/null
+++ b/.github/workflows/build.yml
@@ -0,0 +1,30 @@
+name: .NET
+
+on:
+ push:
+ branches: [ master ]
+ pull_request:
+ branches: [ master ]
+
+jobs:
+ build:
+
+ runs-on: windows-latest
+
+ steps:
+ - uses: actions/checkout@v4
+ - name: Fetch history
+ run: git fetch --prune --unshallow
+ - name: Setup .NET
+ uses: actions/setup-dotnet@v4
+ with:
+ dotnet-version: |
+ 5.0.x
+ 6.0.x
+ 8.0.x
+ - name: Restore dependencies
+ run: dotnet restore DotNetSiemensPLCToolBoxLibrary.sln
+ - name: Build
+ run: dotnet build DotNetSiemensPLCToolBoxLibrary.sln
+ - name: Test
+ run: dotnet test DotNetSiemensPLCToolBoxLibrary.sln
\ No newline at end of file
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
new file mode 100644
index 00000000..e9024963
--- /dev/null
+++ b/.github/workflows/release.yml
@@ -0,0 +1,38 @@
+name: .NET
+
+on:
+ release:
+ types: [published]
+
+jobs:
+ build:
+
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v4
+ - name: Fetch history
+ run: git fetch --prune --unshallow
+ - name: Setup .NET
+ uses: actions/setup-dotnet@v4
+ with:
+ dotnet-version: |
+ 5.0.x
+ 6.0.x
+ 8.0.x
+ - name: Restore dependencies
+ run: dotnet restore DotNetSiemensPLCToolBoxLibrary.sln
+ - name: Update project version
+ uses: roryprimrose/set-vs-sdk-project-version@v1
+ with:
+ version: ${{ github.event.release.tag_name }}
+ assemblyVersion: ${{ github.event.release.tag_name }}
+ fileVersion: ${{ github.event.release.tag_name }}
+ informationalVersion: ${{ github.event.release.tag_name }}-${{ github.sha }}
+ - name: Build
+ run: dotnet build DotNetSiemensPLCToolBoxLibrary.sln
+ - uses: actions/upload-artifact@v4
+ with:
+ path: ./**/DotNetProjects.DotNetSiemensPLCToolBoxLibrary*.nupkg
+# - name: Publish Nuget
+# run: dotnet nuget push DotNetSiemensPLCToolBoxLibrary.sln --api-key ${{secrets.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json
diff --git a/BackupRestoreBlocks/BackupRestoreBlocks.csproj b/BackupRestoreBlocks/BackupRestoreBlocks.csproj
index d42a19ea..f7a1d55f 100644
--- a/BackupRestoreBlocks/BackupRestoreBlocks.csproj
+++ b/BackupRestoreBlocks/BackupRestoreBlocks.csproj
@@ -4,6 +4,7 @@
Exe
net461
true
+ true
true
diff --git a/BackupS7/BackupS7.csproj b/BackupS7/BackupS7.csproj
index c6a72a8b..0b2797c3 100644
--- a/BackupS7/BackupS7.csproj
+++ b/BackupS7/BackupS7.csproj
@@ -3,12 +3,13 @@
Exe
net461
+ true
AnyCPU
-
+
diff --git a/CommandWhenBitSet/CommandWhenBitSet.csproj b/CommandWhenBitSet/CommandWhenBitSet.csproj
index 8079575f..27116891 100644
--- a/CommandWhenBitSet/CommandWhenBitSet.csproj
+++ b/CommandWhenBitSet/CommandWhenBitSet.csproj
@@ -3,7 +3,8 @@
Exe
net461
- true
+ true
+ true
diff --git a/DbfReader/DbfReader.csproj b/DbfReader/DbfReader.csproj
index 672656c4..3b408811 100644
--- a/DbfReader/DbfReader.csproj
+++ b/DbfReader/DbfReader.csproj
@@ -5,6 +5,7 @@
net461
true
true
+ true
diff --git a/DotNetDatenbankProtokollerV2/ConfigurationTool/JFK-ProtokollerConfigurationTool.csproj b/DotNetDatenbankProtokollerV2/ConfigurationTool/JFK-ProtokollerConfigurationTool.csproj
index ad7b8a41..b9daf6b1 100644
--- a/DotNetDatenbankProtokollerV2/ConfigurationTool/JFK-ProtokollerConfigurationTool.csproj
+++ b/DotNetDatenbankProtokollerV2/ConfigurationTool/JFK-ProtokollerConfigurationTool.csproj
@@ -7,6 +7,7 @@
true
DotNetSimaticDatabaseProtokollerConfigurationTool
app.manifest
+ true
AnyCPU
@@ -15,8 +16,8 @@
-
-
+
+
diff --git a/DotNetDatenbankProtokollerV2/DotNetSimaticDatabaseProtokollerService/JFK-ProtokollerService.csproj b/DotNetDatenbankProtokollerV2/DotNetSimaticDatabaseProtokollerService/JFK-ProtokollerService.csproj
index 46844c51..888ffbdd 100644
--- a/DotNetDatenbankProtokollerV2/DotNetSimaticDatabaseProtokollerService/JFK-ProtokollerService.csproj
+++ b/DotNetDatenbankProtokollerV2/DotNetSimaticDatabaseProtokollerService/JFK-ProtokollerService.csproj
@@ -4,6 +4,7 @@
WinExe
net462
true
+ true
true
@@ -20,6 +21,7 @@
+
\ No newline at end of file
diff --git a/DotNetDatenbankProtokollerV2/ProtokollerLibrary/Databases/PostgreSQL/PostgreSQLStorage.cs b/DotNetDatenbankProtokollerV2/ProtokollerLibrary/Databases/PostgreSQL/PostgreSQLStorage.cs
index e9b513bc..b21b7183 100644
--- a/DotNetDatenbankProtokollerV2/ProtokollerLibrary/Databases/PostgreSQL/PostgreSQLStorage.cs
+++ b/DotNetDatenbankProtokollerV2/ProtokollerLibrary/Databases/PostgreSQL/PostgreSQLStorage.cs
@@ -83,7 +83,7 @@ public override void CreateOrModify_TablesAndFields(string dataTable, DatasetCon
}
catch (Npgsql.PostgresException ex)
{
- if (ex.Code != "42P04")
+ if (ex.SqlState != "42P04")
{
Logging.LogText("Database could not be created. Storage: " + myConfig.Name, ex, Logging.LogLevel.Error);
throw ex;
@@ -103,7 +103,7 @@ public override void CreateOrModify_TablesAndFields(string dataTable, DatasetCon
}
catch (Npgsql.PostgresException ex)
{
- if (ex.Code == "42P01")
+ if (ex.SqlState == "42P01")
{
try
{
diff --git a/DotNetDatenbankProtokollerV2/ProtokollerLibrary/JFK-ProtokollerLibrary.csproj b/DotNetDatenbankProtokollerV2/ProtokollerLibrary/JFK-ProtokollerLibrary.csproj
index 4774a563..4987010b 100644
--- a/DotNetDatenbankProtokollerV2/ProtokollerLibrary/JFK-ProtokollerLibrary.csproj
+++ b/DotNetDatenbankProtokollerV2/ProtokollerLibrary/JFK-ProtokollerLibrary.csproj
@@ -4,20 +4,21 @@
Library
net462
true
+ true
-
-
+
+
-
-
-
-
-
+
+
+
+
+
diff --git a/DotNetSiemensPLCToolBoxLibrary.TIAV13/DotNetSiemensPLCToolBoxLibrary.TIAV13.csproj b/DotNetSiemensPLCToolBoxLibrary.TIAV13/DotNetSiemensPLCToolBoxLibrary.TIAV13.csproj
index 0c2987ba..6d8a14da 100644
--- a/DotNetSiemensPLCToolBoxLibrary.TIAV13/DotNetSiemensPLCToolBoxLibrary.TIAV13.csproj
+++ b/DotNetSiemensPLCToolBoxLibrary.TIAV13/DotNetSiemensPLCToolBoxLibrary.TIAV13.csproj
@@ -22,7 +22,7 @@
snupkg
-
+
diff --git a/DotNetSiemensPLCToolBoxLibrary.TIAV14SP1/DotNetSiemensPLCToolBoxLibrary.TIAV14SP1.csproj b/DotNetSiemensPLCToolBoxLibrary.TIAV14SP1/DotNetSiemensPLCToolBoxLibrary.TIAV14SP1.csproj
index 23d27cb5..59c81830 100644
--- a/DotNetSiemensPLCToolBoxLibrary.TIAV14SP1/DotNetSiemensPLCToolBoxLibrary.TIAV14SP1.csproj
+++ b/DotNetSiemensPLCToolBoxLibrary.TIAV14SP1/DotNetSiemensPLCToolBoxLibrary.TIAV14SP1.csproj
@@ -23,7 +23,7 @@
snupkg
-
+
diff --git a/DotNetSiemensPLCToolBoxLibrary.TIAV15/DotNetSiemensPLCToolBoxLibrary.TIAV15.csproj b/DotNetSiemensPLCToolBoxLibrary.TIAV15/DotNetSiemensPLCToolBoxLibrary.TIAV15.csproj
index 759d64d6..62ef7c4f 100644
--- a/DotNetSiemensPLCToolBoxLibrary.TIAV15/DotNetSiemensPLCToolBoxLibrary.TIAV15.csproj
+++ b/DotNetSiemensPLCToolBoxLibrary.TIAV15/DotNetSiemensPLCToolBoxLibrary.TIAV15.csproj
@@ -23,7 +23,7 @@
snupkg
-
+
diff --git a/DotNetSiemensPLCToolBoxLibrary.TIAV15_1/DotNetSiemensPLCToolBoxLibrary.TIAV15_1.csproj b/DotNetSiemensPLCToolBoxLibrary.TIAV15_1/DotNetSiemensPLCToolBoxLibrary.TIAV15_1.csproj
index ce7070c1..ddf9de10 100644
--- a/DotNetSiemensPLCToolBoxLibrary.TIAV15_1/DotNetSiemensPLCToolBoxLibrary.TIAV15_1.csproj
+++ b/DotNetSiemensPLCToolBoxLibrary.TIAV15_1/DotNetSiemensPLCToolBoxLibrary.TIAV15_1.csproj
@@ -23,7 +23,7 @@
snupkg
-
+
diff --git a/DotNetSiemensPLCToolBoxLibrary.TIAV16/DotNetSiemensPLCToolBoxLibrary.TIAV16.csproj b/DotNetSiemensPLCToolBoxLibrary.TIAV16/DotNetSiemensPLCToolBoxLibrary.TIAV16.csproj
index 3da086c0..eef72082 100644
--- a/DotNetSiemensPLCToolBoxLibrary.TIAV16/DotNetSiemensPLCToolBoxLibrary.TIAV16.csproj
+++ b/DotNetSiemensPLCToolBoxLibrary.TIAV16/DotNetSiemensPLCToolBoxLibrary.TIAV16.csproj
@@ -23,7 +23,7 @@
snupkg
-
+
diff --git a/DotNetSiemensPLCToolBoxLibrary.TIAV17/DotNetSiemensPLCToolBoxLibrary.TIAV17.csproj b/DotNetSiemensPLCToolBoxLibrary.TIAV17/DotNetSiemensPLCToolBoxLibrary.TIAV17.csproj
index d4c790f5..cc359fb7 100644
--- a/DotNetSiemensPLCToolBoxLibrary.TIAV17/DotNetSiemensPLCToolBoxLibrary.TIAV17.csproj
+++ b/DotNetSiemensPLCToolBoxLibrary.TIAV17/DotNetSiemensPLCToolBoxLibrary.TIAV17.csproj
@@ -23,7 +23,7 @@
snupkg
-
+
diff --git a/DotNetSiemensPLCToolBoxLibrary.TIAV18/DotNetSiemensPLCToolBoxLibrary.TIAV18.csproj b/DotNetSiemensPLCToolBoxLibrary.TIAV18/DotNetSiemensPLCToolBoxLibrary.TIAV18.csproj
index 78b2fef9..519b3e6b 100644
--- a/DotNetSiemensPLCToolBoxLibrary.TIAV18/DotNetSiemensPLCToolBoxLibrary.TIAV18.csproj
+++ b/DotNetSiemensPLCToolBoxLibrary.TIAV18/DotNetSiemensPLCToolBoxLibrary.TIAV18.csproj
@@ -23,7 +23,7 @@
snupkg
-
+
diff --git a/DotNetSiemensPLCToolBoxLibrary.TIAV19/DotNetSiemensPLCToolBoxLibrary.TIAV19.csproj b/DotNetSiemensPLCToolBoxLibrary.TIAV19/DotNetSiemensPLCToolBoxLibrary.TIAV19.csproj
index 6fff09b5..7f5a65c1 100644
--- a/DotNetSiemensPLCToolBoxLibrary.TIAV19/DotNetSiemensPLCToolBoxLibrary.TIAV19.csproj
+++ b/DotNetSiemensPLCToolBoxLibrary.TIAV19/DotNetSiemensPLCToolBoxLibrary.TIAV19.csproj
@@ -23,7 +23,7 @@
snupkg
-
+
diff --git a/ExampleWPFVisualization/ExampleWPFVisualization.csproj b/ExampleWPFVisualization/ExampleWPFVisualization.csproj
index 33d388ea..e284635e 100644
--- a/ExampleWPFVisualization/ExampleWPFVisualization.csproj
+++ b/ExampleWPFVisualization/ExampleWPFVisualization.csproj
@@ -4,6 +4,7 @@
WinExe
net461
true
+ true
diff --git a/LibNoDaveConnectionLibrary.WinForms/DotNetSiemensPLCToolBoxLibrary.WinForms.csproj b/LibNoDaveConnectionLibrary.WinForms/DotNetSiemensPLCToolBoxLibrary.WinForms.csproj
index e8ebdce7..cea1bbf5 100644
--- a/LibNoDaveConnectionLibrary.WinForms/DotNetSiemensPLCToolBoxLibrary.WinForms.csproj
+++ b/LibNoDaveConnectionLibrary.WinForms/DotNetSiemensPLCToolBoxLibrary.WinForms.csproj
@@ -2,8 +2,10 @@
false
Library
- netcoreapp3.0;net461
+ net6.0-windows;net461
true
+ true
+ true
DotNetProjects.DotNetSiemensPLCToolBoxLibrary.WinForms
@@ -22,13 +24,14 @@
snupkg
-
+
-
+
+
-
-
+
+
diff --git a/LibNoDaveConnectionLibrary/DotNetSiemensPLCToolBoxLibrary.csproj b/LibNoDaveConnectionLibrary/DotNetSiemensPLCToolBoxLibrary.csproj
index e55c57f6..b1bc6050 100644
--- a/LibNoDaveConnectionLibrary/DotNetSiemensPLCToolBoxLibrary.csproj
+++ b/LibNoDaveConnectionLibrary/DotNetSiemensPLCToolBoxLibrary.csproj
@@ -23,7 +23,7 @@
snupkg
-
+
@@ -38,7 +38,7 @@
-
+
SHARPZIPLIB;NETSTANDARD
@@ -47,6 +47,6 @@
5.0.0
-
+
\ No newline at end of file
diff --git a/MultipleSPSExample/MultipleSPSExample.csproj b/MultipleSPSExample/MultipleSPSExample.csproj
index 8d274721..0ffbac76 100644
--- a/MultipleSPSExample/MultipleSPSExample.csproj
+++ b/MultipleSPSExample/MultipleSPSExample.csproj
@@ -4,6 +4,7 @@
WinExe
net461
true
+ true
diff --git a/Projects/Kopplungstester/Kopplungstester.csproj b/Projects/Kopplungstester/Kopplungstester.csproj
index 054dec6d..48e71aee 100644
--- a/Projects/Kopplungstester/Kopplungstester.csproj
+++ b/Projects/Kopplungstester/Kopplungstester.csproj
@@ -4,6 +4,7 @@
WinExe
net462
true
+ true
true
diff --git a/ReadSpeedtest/ReadSpeedtest.csproj b/ReadSpeedtest/ReadSpeedtest.csproj
index 67d2fef9..da8a58e4 100644
--- a/ReadSpeedtest/ReadSpeedtest.csproj
+++ b/ReadSpeedtest/ReadSpeedtest.csproj
@@ -4,6 +4,7 @@
WinExe
net461
true
+ true
diff --git a/ReadTools/ToolReader.csproj b/ReadTools/ToolReader.csproj
index 8d274721..0ffbac76 100644
--- a/ReadTools/ToolReader.csproj
+++ b/ReadTools/ToolReader.csproj
@@ -4,6 +4,7 @@
WinExe
net461
true
+ true
diff --git a/S7ProjectBlockComparer/S7ProjectBlockComparer.csproj b/S7ProjectBlockComparer/S7ProjectBlockComparer.csproj
index 35527261..f03f266c 100644
--- a/S7ProjectBlockComparer/S7ProjectBlockComparer.csproj
+++ b/S7ProjectBlockComparer/S7ProjectBlockComparer.csproj
@@ -2,8 +2,9 @@
false
WinExe
- net462
+ net48
true
+ true
@@ -14,8 +15,8 @@
-
-
+
+
diff --git a/SimpleCSharpDemonstartion/SimpleCSharpDemonstration.csproj b/SimpleCSharpDemonstartion/SimpleCSharpDemonstration.csproj
index c4bba0d4..1c0dbe37 100644
--- a/SimpleCSharpDemonstartion/SimpleCSharpDemonstration.csproj
+++ b/SimpleCSharpDemonstartion/SimpleCSharpDemonstration.csproj
@@ -4,6 +4,7 @@
WinExe
net462
true
+ true
diff --git a/SimpleCSharpService/SimpleCSharpService.csproj b/SimpleCSharpService/SimpleCSharpService.csproj
index 357d2788..113f9740 100644
--- a/SimpleCSharpService/SimpleCSharpService.csproj
+++ b/SimpleCSharpService/SimpleCSharpService.csproj
@@ -4,6 +4,7 @@
WinExe
net461
true
+ true
diff --git a/SimpleTcpSocketWPF/SimpleTcpSocketWPF.csproj b/SimpleTcpSocketWPF/SimpleTcpSocketWPF.csproj
index 93aa5b11..e0743a1a 100644
--- a/SimpleTcpSocketWPF/SimpleTcpSocketWPF.csproj
+++ b/SimpleTcpSocketWPF/SimpleTcpSocketWPF.csproj
@@ -2,12 +2,13 @@
false
WinExe
- net461
+ net48
true
+ true
true
-
+
diff --git a/TCPForwarder/TCPForwarder.csproj b/TCPForwarder/TCPForwarder.csproj
index 4bd7e621..3567893c 100644
--- a/TCPForwarder/TCPForwarder.csproj
+++ b/TCPForwarder/TCPForwarder.csproj
@@ -4,6 +4,7 @@
WinExe
net462
true
+ true
diff --git a/TestLibrary/TestLibrary.csproj b/TestLibrary/TestLibrary.csproj
index efb639c7..d31dfd23 100644
--- a/TestLibrary/TestLibrary.csproj
+++ b/TestLibrary/TestLibrary.csproj
@@ -4,6 +4,7 @@
WinExe
net461
true
+ true
diff --git a/TestProjectFileFunctions/ToolboxForSiemensPLCs.csproj b/TestProjectFileFunctions/ToolboxForSiemensPLCs.csproj
index fdf7ef61..7e3c8dba 100644
--- a/TestProjectFileFunctions/ToolboxForSiemensPLCs.csproj
+++ b/TestProjectFileFunctions/ToolboxForSiemensPLCs.csproj
@@ -4,7 +4,8 @@
WinExe
net48
true
- true
+ true
+ true
diff --git a/TestVB/TestVB.vbproj b/TestVB/TestVB.vbproj
index c30307fa..cdd127bd 100644
--- a/TestVB/TestVB.vbproj
+++ b/TestVB/TestVB.vbproj
@@ -4,6 +4,7 @@
net462
true
TestVB.Form1
+ true
diff --git a/TiaGitHandler/TiaGitHandler.csproj b/TiaGitHandler/TiaGitHandler.csproj
index ebc94da5..21a26e86 100644
--- a/TiaGitHandler/TiaGitHandler.csproj
+++ b/TiaGitHandler/TiaGitHandler.csproj
@@ -6,6 +6,7 @@
net48
true
true
+ true
false
diff --git a/TiaImporter/TiaImporter.csproj b/TiaImporter/TiaImporter.csproj
index a9f928c0..e8eb990f 100644
--- a/TiaImporter/TiaImporter.csproj
+++ b/TiaImporter/TiaImporter.csproj
@@ -5,15 +5,15 @@
net48
+ true
-
-
-
-
-
-
+
+
+
+
+
\ No newline at end of file
diff --git a/ToolBoxLibUnitTests/TestCRC.cs b/ToolBoxLibUnitTests/TestCRC.cs
index 1810db0e..40214a95 100644
--- a/ToolBoxLibUnitTests/TestCRC.cs
+++ b/ToolBoxLibUnitTests/TestCRC.cs
@@ -1,5 +1,6 @@
using DotNetSiemensPLCToolBoxLibrary.General;
using NUnit.Framework;
+using NUnit.Framework.Legacy;
namespace ToolBoxLibUnitTests
{
@@ -12,7 +13,7 @@ public void TestCRC16BlockSum()
//see: https://www.sps-forum.de/hochsprachen-opc/56412-upload-von-block-zur-s7-2.html
var bytes = new byte[] { 0x0C, 0x00, 0x0E, 0xC0, 0x00, 0xC1, 0x00, 0xC3, 0x00, 0xC4, 0x00, 0xC5, 0x00, 0xD8, 0x80, 0x65, 0x00 };
var crc = CrcHelper.GetCrc16(bytes);
- Assert.AreEqual(crc, 0x7822);
+ ClassicAssert.AreEqual(crc, 0x7822);
}
}
}
diff --git a/ToolBoxLibUnitTests/TestDataBlockReading.cs b/ToolBoxLibUnitTests/TestDataBlockReading.cs
index f8049a2d..4aaeca66 100644
--- a/ToolBoxLibUnitTests/TestDataBlockReading.cs
+++ b/ToolBoxLibUnitTests/TestDataBlockReading.cs
@@ -3,7 +3,8 @@
using DotNetSiemensPLCToolBoxLibrary.DataTypes.Blocks.Step7V5;
using DotNetSiemensPLCToolBoxLibrary.DataTypes.Projectfolders.Step7V5;
using DotNetSiemensPLCToolBoxLibrary.DataTypes.AWL.Step7V5;
-using NUnit.Framework;
+using NUnit.Framework;
+using NUnit.Framework.Legacy;
namespace ToolBoxLibUnitTests
{
@@ -25,14 +26,14 @@ public void TestDB1()
.DB,
false,
fld, blk, new S7ConvertingOptions());
- Assert.AreEqual(test.Children[0].Name, "DB_VAR");
- Assert.AreEqual(test.Children[1].Name, "aa");
- Assert.AreEqual(test.Children[2].Name, "bb");
- Assert.AreEqual(test.Children[3].Name, "aa1");
- Assert.AreEqual(((S7DataRow)test.Children[0]).BlockAddress.ByteAddress, 0);
- Assert.AreEqual(((S7DataRow)test.Children[1]).BlockAddress.ByteAddress, 2);
- Assert.AreEqual(((S7DataRow)test.Children[2]).BlockAddress.ByteAddress, 10);
- Assert.AreEqual(((S7DataRow)test.Children[3]).BlockAddress.ByteAddress, 12);
+ ClassicAssert.AreEqual(test.Children[0].Name, "DB_VAR");
+ ClassicAssert.AreEqual(test.Children[1].Name, "aa");
+ ClassicAssert.AreEqual(test.Children[2].Name, "bb");
+ ClassicAssert.AreEqual(test.Children[3].Name, "aa1");
+ ClassicAssert.AreEqual(((S7DataRow)test.Children[0]).BlockAddress.ByteAddress, 0);
+ ClassicAssert.AreEqual(((S7DataRow)test.Children[1]).BlockAddress.ByteAddress, 2);
+ ClassicAssert.AreEqual(((S7DataRow)test.Children[2]).BlockAddress.ByteAddress, 10);
+ ClassicAssert.AreEqual(((S7DataRow)test.Children[3]).BlockAddress.ByteAddress, 12);
}
[Test]
@@ -49,12 +50,12 @@ public void TestDB2()
.DB,
false,
fld, blk, new S7ConvertingOptions());
- Assert.AreEqual(test.Children[0].Name, "Fachkoordinate");
- Assert.AreEqual(((S7DataRow)test.Children[0]).ArrayStart[0], 0);
- Assert.AreEqual(((S7DataRow)test.Children[0]).ArrayStart[1], 1);
- Assert.AreEqual(((S7DataRow)test.Children[0]).ArrayStop[0], 67);
- Assert.AreEqual(((S7DataRow)test.Children[0]).ArrayStop[1], 2);
- Assert.AreEqual(((S7DataRow)test.Children[0]).ByteLength, 544);
+ ClassicAssert.AreEqual(test.Children[0].Name, "Fachkoordinate");
+ ClassicAssert.AreEqual(((S7DataRow)test.Children[0]).ArrayStart[0], 0);
+ ClassicAssert.AreEqual(((S7DataRow)test.Children[0]).ArrayStart[1], 1);
+ ClassicAssert.AreEqual(((S7DataRow)test.Children[0]).ArrayStop[0], 67);
+ ClassicAssert.AreEqual(((S7DataRow)test.Children[0]).ArrayStop[1], 2);
+ ClassicAssert.AreEqual(((S7DataRow)test.Children[0]).ByteLength, 544);
}
[Test]
@@ -71,14 +72,14 @@ public void TestDB3()
.DB,
false,
fld, blk, new S7ConvertingOptions());
- Assert.AreEqual(test.Children[0].Name, "X_KOORDINATE");
- Assert.AreEqual(((S7DataRow)test.Children[0]).ArrayStart[0], 0);
- Assert.AreEqual(((S7DataRow)test.Children[0]).ArrayStart[1], 0);
- Assert.AreEqual(((S7DataRow)test.Children[0]).ArrayStart[2], 1);
- Assert.AreEqual(((S7DataRow)test.Children[0]).ArrayStop[0], 67);
- Assert.AreEqual(((S7DataRow)test.Children[0]).ArrayStop[1], 16);
- Assert.AreEqual(((S7DataRow)test.Children[0]).ArrayStop[2], 2);
- Assert.AreEqual(((S7DataRow)test.Children[0]).ByteLength, 4624);
+ ClassicAssert.AreEqual(test.Children[0].Name, "X_KOORDINATE");
+ ClassicAssert.AreEqual(((S7DataRow)test.Children[0]).ArrayStart[0], 0);
+ ClassicAssert.AreEqual(((S7DataRow)test.Children[0]).ArrayStart[1], 0);
+ ClassicAssert.AreEqual(((S7DataRow)test.Children[0]).ArrayStart[2], 1);
+ ClassicAssert.AreEqual(((S7DataRow)test.Children[0]).ArrayStop[0], 67);
+ ClassicAssert.AreEqual(((S7DataRow)test.Children[0]).ArrayStop[1], 16);
+ ClassicAssert.AreEqual(((S7DataRow)test.Children[0]).ArrayStop[2], 2);
+ ClassicAssert.AreEqual(((S7DataRow)test.Children[0]).ByteLength, 4624);
}
[Test]
diff --git a/ToolBoxLibUnitTests/TestLibNoDaveReading.cs b/ToolBoxLibUnitTests/TestLibNoDaveReading.cs
index 302e018b..3e9bccb4 100644
--- a/ToolBoxLibUnitTests/TestLibNoDaveReading.cs
+++ b/ToolBoxLibUnitTests/TestLibNoDaveReading.cs
@@ -2,7 +2,8 @@
using System;
using System.Collections.Generic;
using DotNetSiemensPLCToolBoxLibrary.Communication.LibNoDave;
-using NUnit.Framework;
+using NUnit.Framework;
+using NUnit.Framework.Legacy;
namespace ToolBoxLibUnitTests
{
@@ -23,7 +24,7 @@ public void TestReading()
string t =
@"READ Area:132, DBnum:10, Start:10, Bytes:300
READ Area:132, DBnum:60, Start:0, Bytes:300";
- Assert.AreEqual(req.Replace("\r\n", "\n"), t.Replace("\r\n", "\n"));
+ ClassicAssert.AreEqual(req.Replace("\r\n", "\n"), t.Replace("\r\n", "\n"));
//var wrapper2 = new ConnectionWrapper(480);
//var conn2 = new PLCConnection(new PLCConnectionConfiguration(), wrapper2);
@@ -34,7 +35,7 @@ public void TestReading()
//var pdus2 = wrapper2.PDUs;
//string req2 = string.Join(Environment.NewLine, pdus2);
//string t2 = "READ Area:132, DBnum:10, Start:10, Bytes:300\r\nREAD Area:132, DBnum:60, Start:0, Bytes:300";
- //Assert.AreEqual(req2, t2);
+ //ClassicAssert.AreEqual(req2, t2);
var wrapper3 = new ConnectionWrapper(480);
var conn3 = new PLCConnection(new PLCConnectionConfiguration(), wrapper3);
@@ -45,7 +46,7 @@ public void TestReading()
var pdus3 = wrapper3.PDUs;
string req3 = string.Join(Environment.NewLine, pdus3);
string t3 = "READ Area:132, DBnum:10, Start:10, Bytes:300\r\nREAD Area:132, DBnum:60, Start:0, Bytes:140\r\nREAD Area:132, DBnum:60, Start:140, Bytes:160";
- Assert.AreEqual(req3.Replace("\r\n", "\n"), t3.Replace("\r\n", "\n"));
+ ClassicAssert.AreEqual(req3.Replace("\r\n", "\n"), t3.Replace("\r\n", "\n"));
var wrapper4 = new ConnectionWrapper(480);
var conn4 = new PLCConnection(new PLCConnectionConfiguration(), wrapper4);
@@ -60,7 +61,7 @@ public void TestReading()
var pdus4 = wrapper4.PDUs;
string req4 = string.Join(Environment.NewLine, pdus4);
string t4 = "READ Area:132, DBnum:1, Start:0, Bytes:14\r\nREAD Area:132, DBnum:1, Start:30, Bytes:4\r\nREAD Area:132, DBnum:1, Start:50, Bytes:4\r\nREAD Area:132, DBnum:1, Start:80, Bytes:4";
- Assert.AreEqual(req4.Replace("\r\n", "\n"), t4.Replace("\r\n", "\n"));
+ ClassicAssert.AreEqual(req4.Replace("\r\n", "\n"), t4.Replace("\r\n", "\n"));
var wrapper5 = new ConnectionWrapper(240);
var conn5 = new PLCConnection(new PLCConnectionConfiguration(), wrapper5);
@@ -85,7 +86,7 @@ public void TestReading()
var pdus5 = wrapper5.PDUs;
string req5 = string.Join(Environment.NewLine, pdus5);
string t5 = "READ Area:132, DBnum:1, Start:0, Bytes:14\r\nREAD Area:132, DBnum:1, Start:30, Bytes:4\r\nREAD Area:132, DBnum:1, Start:50, Bytes:4\r\nREAD Area:132, DBnum:1, Start:80, Bytes:4\r\nREAD Area:132, DBnum:1, Start:90, Bytes:30\r\nREAD Area:132, DBnum:1, Start:140, Bytes:4\r\nREAD Area:132, DBnum:1, Start:160, Bytes:4\r\nREAD Area:132, DBnum:1, Start:180, Bytes:44\r\nREAD Area:132, DBnum:1, Start:230, Bytes:24\r\nREAD Area:132, DBnum:1, Start:260, Bytes:4\r\nREAD Area:132, DBnum:1, Start:270, Bytes:4";
- Assert.AreEqual(req5.Replace("\r\n", "\n"), t5.Replace("\r\n", "\n"));
+ ClassicAssert.AreEqual(req5.Replace("\r\n", "\n"), t5.Replace("\r\n", "\n"));
//var tag=new PLCNckTag() { TagDataType = TagDataType.Float, NckArea = 0xa, NckUnit = 0x8,NckColumn = 0x23, NckLine = 0x1,NckModule = 0x1a,NckLinecount = 0x1};
}
@@ -103,7 +104,7 @@ public void TestReading2()
var pdus = wrapper.PDUs;
string req = string.Join(Environment.NewLine, pdus);
string t = "READ Area:132, DBnum:2, Start:0, Bytes:3";
- Assert.AreEqual(req, t);
+ ClassicAssert.AreEqual(req, t);
}
[Test]
@@ -134,7 +135,7 @@ public void TestReading3()
var pdus = wrapper.PDUs;
string req = string.Join(Environment.NewLine, pdus);
string t = "READ Area:132, DBnum:781, Start:3, Bytes:11";
- Assert.AreEqual(req, t);
+ ClassicAssert.AreEqual(req, t);
}
[Test]
@@ -151,7 +152,7 @@ public void TestReading4()
var pdus = wrapper.PDUs;
string req = string.Join(Environment.NewLine, pdus);
string t = "READ Area:132, DBnum:781, Start:5, Bytes:6";
- Assert.AreEqual(req, t);
+ ClassicAssert.AreEqual(req, t);
}
[Test]
@@ -169,7 +170,7 @@ public void TestReading5()
var pdus = wrapper.PDUs;
string req = string.Join(Environment.NewLine, pdus);
string t = "READ Area:132, DBnum:781, Start:5, Bytes:11";
- Assert.AreEqual(req, t);
+ ClassicAssert.AreEqual(req, t);
}
[Test]
@@ -187,7 +188,7 @@ public void TestReading6()
var pdus = wrapper.PDUs;
string req = string.Join(Environment.NewLine, pdus);
string t = "READ Area:132, DBnum:781, Start:5, Bytes:11";
- Assert.AreEqual(req, t);
+ ClassicAssert.AreEqual(req, t);
}
class ConnectionWrapperResult : ConnectionWrapper
@@ -243,7 +244,7 @@ public void TestReading7()
var pdus = wrapper.PDUs;
string req = string.Join(Environment.NewLine, pdus);
string t = "READ Area:132, DBnum:781, Start:0, Bytes:6";
- Assert.AreEqual(req, t);
+ ClassicAssert.AreEqual(req, t);
}
}
diff --git a/ToolBoxLibUnitTests/TestMC7Converter.cs b/ToolBoxLibUnitTests/TestMC7Converter.cs
index a9c8d07e..ebc7b410 100644
--- a/ToolBoxLibUnitTests/TestMC7Converter.cs
+++ b/ToolBoxLibUnitTests/TestMC7Converter.cs
@@ -4,6 +4,7 @@
using DotNetSiemensPLCToolBoxLibrary.DataTypes;
using System.Collections.Generic;
using NUnit.Framework;
+using NUnit.Framework.Legacy;
namespace ToolBoxLibUnitTests
{
@@ -29,11 +30,11 @@ public void ParseDataBlocks()
block = File.ReadAllBytes(dir + "DB121.bin");
S7DataBlock DB = (S7DataBlock)DotNetSiemensPLCToolBoxLibrary.PLCs.S7_xxx.MC7.MC7Converter.GetAWLBlock(block, MnemonicLanguage.German);
- Assert.AreEqual(PLCBlockType.DB, DB.BlockType);
- Assert.AreEqual(121, DB.BlockNumber);
- Assert.AreEqual(21418, DB.Length); //Load memory Size
- Assert.AreEqual(20824, DB.CodeSize); //Data size, this is the relevant data length
- Assert.AreEqual(File.ReadAllText(dir + "DB121.awl").Trim().Replace("\r\n", "\n"), DB.ToString().Trim().Replace("\r\n", "\n"));
+ ClassicAssert.AreEqual(PLCBlockType.DB, DB.BlockType);
+ ClassicAssert.AreEqual(121, DB.BlockNumber);
+ ClassicAssert.AreEqual(21418, DB.Length); //Load memory Size
+ ClassicAssert.AreEqual(20824, DB.CodeSize); //Data size, this is the relevant data length
+ ClassicAssert.AreEqual(File.ReadAllText(dir + "DB121.awl").Trim().Replace("\r\n", "\n"), DB.ToString().Trim().Replace("\r\n", "\n"));
//_____________________________________________________________________________
//Read Data-block With long Array of Structs
@@ -41,11 +42,11 @@ public void ParseDataBlocks()
block = File.ReadAllBytes(dir + "DB13.bin");
DB = (S7DataBlock)DotNetSiemensPLCToolBoxLibrary.PLCs.S7_xxx.MC7.MC7Converter.GetAWLBlock(block, MnemonicLanguage.German);
- Assert.AreEqual(PLCBlockType.DB, DB.BlockType);
- Assert.AreEqual(13, DB.BlockNumber);
- Assert.AreEqual(64214, DB.Length); //Load memory Size
- Assert.AreEqual(64040, DB.CodeSize); //Data size, this is the relevant data length
- Assert.AreEqual(File.ReadAllText(dir + "DB13.awl").Trim().Replace("\r\n", "\n"), DB.ToString().Trim().Replace("\r\n", "\n"));
+ ClassicAssert.AreEqual(PLCBlockType.DB, DB.BlockType);
+ ClassicAssert.AreEqual(13, DB.BlockNumber);
+ ClassicAssert.AreEqual(64214, DB.Length); //Load memory Size
+ ClassicAssert.AreEqual(64040, DB.CodeSize); //Data size, this is the relevant data length
+ ClassicAssert.AreEqual(File.ReadAllText(dir + "DB13.awl").Trim().Replace("\r\n", "\n"), DB.ToString().Trim().Replace("\r\n", "\n"));
//_____________________________________________________________________________
//Read Data-block With array and single Static Reals
@@ -53,11 +54,11 @@ public void ParseDataBlocks()
block = File.ReadAllBytes(dir + "DB4.bin");
DB = (S7DataBlock)DotNetSiemensPLCToolBoxLibrary.PLCs.S7_xxx.MC7.MC7Converter.GetAWLBlock(block, MnemonicLanguage.German);
- Assert.AreEqual(PLCBlockType.DB, DB.BlockType);
- Assert.AreEqual(4, DB.BlockNumber);
- Assert.AreEqual(8094, DB.Length); //Load memory Size
- Assert.AreEqual(6000, DB.CodeSize); //Data size, this is the relevant data length
- Assert.AreEqual(File.ReadAllText(dir + "DB4.awl").Trim().Replace("\r\n", "\n"), DB.Structure.ToString().Trim().Replace("\r\n", "\n"));
+ ClassicAssert.AreEqual(PLCBlockType.DB, DB.BlockType);
+ ClassicAssert.AreEqual(4, DB.BlockNumber);
+ ClassicAssert.AreEqual(8094, DB.Length); //Load memory Size
+ ClassicAssert.AreEqual(6000, DB.CodeSize); //Data size, this is the relevant data length
+ ClassicAssert.AreEqual(File.ReadAllText(dir + "DB4.awl").Trim().Replace("\r\n", "\n"), DB.Structure.ToString().Trim().Replace("\r\n", "\n"));
}
[Test]
@@ -71,21 +72,21 @@ public void ParseFunctionCodeBlocks()
block = File.ReadAllBytes(dir + "FC1.bin");
S7FunctionBlock FC = (S7FunctionBlock)DotNetSiemensPLCToolBoxLibrary.PLCs.S7_xxx.MC7.MC7Converter.GetAWLBlock(block, MnemonicLanguage.German);
- Assert.AreEqual(PLCBlockType.FC, FC.BlockType);
- Assert.AreEqual(1, FC.BlockNumber);
- Assert.AreEqual(434, FC.Length); //Load memory Size
- Assert.AreEqual(342, FC.CodeSize); //Code size of pure MC7
- Assert.AreEqual(6, FC.LocalDataSize); //Actually there are no "Temp" but the local data is needed for the "Call"'s
- Assert.AreEqual(4, FC.Networks.Count);
+ ClassicAssert.AreEqual(PLCBlockType.FC, FC.BlockType);
+ ClassicAssert.AreEqual(1, FC.BlockNumber);
+ ClassicAssert.AreEqual(434, FC.Length); //Load memory Size
+ ClassicAssert.AreEqual(342, FC.CodeSize); //Code size of pure MC7
+ ClassicAssert.AreEqual(6, FC.LocalDataSize); //Actually there are no "Temp" but the local data is needed for the "Call"'s
+ ClassicAssert.AreEqual(4, FC.Networks.Count);
//Some of the called functions
List tmp = new List(FC.CalledBlocks);
- Assert.AreEqual("FC96", tmp[2]);
- Assert.AreEqual("FC97", tmp[7]);
- Assert.AreEqual("FC16", tmp[11]);
- Assert.AreEqual("FC21", tmp[13]);
+ ClassicAssert.AreEqual("FC96", tmp[2]);
+ ClassicAssert.AreEqual("FC97", tmp[7]);
+ ClassicAssert.AreEqual("FC16", tmp[11]);
+ ClassicAssert.AreEqual("FC21", tmp[13]);
- Assert.AreEqual(File.ReadAllText(dir + "FC1.awl").Trim().Replace("\r\n", "\n"), FC.ToString().Trim().Replace("\r\n", "\n"));
+ ClassicAssert.AreEqual(File.ReadAllText(dir + "FC1.awl").Trim().Replace("\r\n", "\n"), FC.ToString().Trim().Replace("\r\n", "\n"));
//_____________________________________________________________________________
//Read complex Function-code
@@ -94,21 +95,21 @@ public void ParseFunctionCodeBlocks()
block = File.ReadAllBytes(dir + "FC100.bin");
FC = (S7FunctionBlock)DotNetSiemensPLCToolBoxLibrary.PLCs.S7_xxx.MC7.MC7Converter.GetAWLBlock(block, MnemonicLanguage.German);
- Assert.AreEqual(PLCBlockType.FC, FC.BlockType);
- Assert.AreEqual(100, FC.BlockNumber);
- Assert.AreEqual(4182, FC.Length); //Load memory Size
- Assert.AreEqual(3882, FC.CodeSize); //Code size of pure MC7
- Assert.AreEqual(58, FC.LocalDataSize);
- Assert.AreEqual(9, FC.Networks.Count);
+ ClassicAssert.AreEqual(PLCBlockType.FC, FC.BlockType);
+ ClassicAssert.AreEqual(100, FC.BlockNumber);
+ ClassicAssert.AreEqual(4182, FC.Length); //Load memory Size
+ ClassicAssert.AreEqual(3882, FC.CodeSize); //Code size of pure MC7
+ ClassicAssert.AreEqual(58, FC.LocalDataSize);
+ ClassicAssert.AreEqual(9, FC.Networks.Count);
//Some of the called functions
tmp = new List(FC.CalledBlocks);
- Assert.AreEqual("SFC20", tmp[0]);
- Assert.AreEqual("FC6", tmp[6]);
- Assert.AreEqual("FC[LW16]", tmp[18]);
- Assert.AreEqual("SFC20", tmp[22]);
+ ClassicAssert.AreEqual("SFC20", tmp[0]);
+ ClassicAssert.AreEqual("FC6", tmp[6]);
+ ClassicAssert.AreEqual("FC[LW16]", tmp[18]);
+ ClassicAssert.AreEqual("SFC20", tmp[22]);
- Assert.AreEqual(File.ReadAllText(dir + "FC100.awl").Trim().Replace("\r\n", "\n"), FC.ToString().Trim().Replace("\r\n", "\n"));
+ ClassicAssert.AreEqual(File.ReadAllText(dir + "FC100.awl").Trim().Replace("\r\n", "\n"), FC.ToString().Trim().Replace("\r\n", "\n"));
}
[Test]
@@ -121,33 +122,33 @@ public void ParseFunctionBlocks()
block = File.ReadAllBytes(dir + "FB101.bin");
S7FunctionBlock FB = (S7FunctionBlock)DotNetSiemensPLCToolBoxLibrary.PLCs.S7_xxx.MC7.MC7Converter.GetAWLBlock(block, MnemonicLanguage.German);
- Assert.AreEqual(PLCBlockType.FB, FB.BlockType);
- Assert.AreEqual(101, FB.BlockNumber);
- Assert.AreEqual(128, FB.Length); //Load memory Size
- Assert.AreEqual(24, FB.CodeSize); //Code size of pure MC7
- Assert.AreEqual(4, FB.LocalDataSize);
- Assert.AreEqual(3, FB.Networks.Count);
+ ClassicAssert.AreEqual(PLCBlockType.FB, FB.BlockType);
+ ClassicAssert.AreEqual(101, FB.BlockNumber);
+ ClassicAssert.AreEqual(128, FB.Length); //Load memory Size
+ ClassicAssert.AreEqual(24, FB.CodeSize); //Code size of pure MC7
+ ClassicAssert.AreEqual(4, FB.LocalDataSize);
+ ClassicAssert.AreEqual(3, FB.Networks.Count);
//Some of the called functions
List tmp = new List(FB.CalledBlocks);
- Assert.AreEqual("FC100", tmp[0]);
+ ClassicAssert.AreEqual("FC100", tmp[0]);
- Assert.AreEqual(File.ReadAllText(dir + "FB101.awl").Trim().Replace("\r\n", "\n"), FB.ToString().Trim().Replace("\r\n", "\n"));
+ ClassicAssert.AreEqual(File.ReadAllText(dir + "FB101.awl").Trim().Replace("\r\n", "\n"), FB.ToString().Trim().Replace("\r\n", "\n"));
//_____________________________________________________________________________
//Read Function-Block with Instance data
block = File.ReadAllBytes(dir + "FB1001.bin");
FB = (S7FunctionBlock)DotNetSiemensPLCToolBoxLibrary.PLCs.S7_xxx.MC7.MC7Converter.GetAWLBlock(block, MnemonicLanguage.German);
- Assert.AreEqual(PLCBlockType.FB, FB.BlockType);
- Assert.AreEqual(1001, FB.BlockNumber);
- Assert.AreEqual(126, FB.Length); //Load memory Size
- Assert.AreEqual(22, FB.CodeSize); //Code size of pure MC7
- Assert.AreEqual(0, FB.LocalDataSize); //No temp data, all data is in STAT
- Assert.AreEqual(1, FB.Networks.Count);
+ ClassicAssert.AreEqual(PLCBlockType.FB, FB.BlockType);
+ ClassicAssert.AreEqual(1001, FB.BlockNumber);
+ ClassicAssert.AreEqual(126, FB.Length); //Load memory Size
+ ClassicAssert.AreEqual(22, FB.CodeSize); //Code size of pure MC7
+ ClassicAssert.AreEqual(0, FB.LocalDataSize); //No temp data, all data is in STAT
+ ClassicAssert.AreEqual(1, FB.Networks.Count);
string t = FB.ToString();
- Assert.AreEqual(File.ReadAllText(dir + "FB1001.awl").Trim().Replace("\r\n", "\n"), FB.ToString().Trim().Replace("\r\n", "\n"));
+ ClassicAssert.AreEqual(File.ReadAllText(dir + "FB1001.awl").Trim().Replace("\r\n", "\n"), FB.ToString().Trim().Replace("\r\n", "\n"));
}
@@ -160,7 +161,7 @@ public void ParseFBWithoutSegmentTAble()
//Fix up different culture dependent Date conversion
//this might not be optimal, but i dont have any better solution at the moment.
string AWL = File.ReadAllText(dir + "FB751.awl").Trim().Replace("\r\n", "\n");
- Assert.AreEqual(AWL, DB.ToString().Trim().Replace("\r\n", "\n"));
+ ClassicAssert.AreEqual(AWL, DB.ToString().Trim().Replace("\r\n", "\n"));
}
[Test(Description = "This block contains an unconditional call of an IN.Block_FB parameter without Parameters 'UC #IN2'")]
@@ -172,7 +173,7 @@ public void ParseFcWithParameterlessUnconditionalCall()
//Fix up different culture dependent Date conversion
//this might not be optimal, but i dont have any better solution at the moment.
string AWL = File.ReadAllText(dir + "FC21.awl").Trim().Replace("\r\n", "\n");
- Assert.AreEqual(AWL, DB.ToString().Trim().Replace("\r\n", "\n"));
+ ClassicAssert.AreEqual(AWL, DB.ToString().Trim().Replace("\r\n", "\n"));
}
[Test(Description = "This contains a complex DB")]
@@ -184,7 +185,7 @@ public void ParseComplexDB()
//Fix up different culture dependent Date conversion
//this might not be optimal, but i dont have any better solution at the moment.
//string AWL = File.ReadAllText(dir + "FC21.awl").Trim().Replace("\r\n", "\n");
- //Assert.AreEqual(AWL, DB.ToString().Trim().Replace("\r\n", "\n"));
+ //ClassicAssert.AreEqual(AWL, DB.ToString().Trim().Replace("\r\n", "\n"));
}
}
}
diff --git a/ToolBoxLibUnitTests/TestPLCBlockName.cs b/ToolBoxLibUnitTests/TestPLCBlockName.cs
index 38cc5777..9ed1cf5f 100644
--- a/ToolBoxLibUnitTests/TestPLCBlockName.cs
+++ b/ToolBoxLibUnitTests/TestPLCBlockName.cs
@@ -1,5 +1,6 @@
using DotNetSiemensPLCToolBoxLibrary.DataTypes;
-using NUnit.Framework;
+using NUnit.Framework;
+using NUnit.Framework.Legacy;
namespace ToolBoxLibUnitTests
{
@@ -10,28 +11,28 @@ public class TestPLCBlockName
public void TestParse()
{
PLCBlockName test = new PLCBlockName("DB5");
- Assert.AreEqual(5, test.BlockNumber);
- Assert.AreEqual(PLCBlockType.DB, test.BlockType);
+ ClassicAssert.AreEqual(5, test.BlockNumber);
+ ClassicAssert.AreEqual(PLCBlockType.DB, test.BlockType);
test = new PLCBlockName("db 5");
- Assert.AreEqual(5, test.BlockNumber);
- Assert.AreEqual(PLCBlockType.DB, test.BlockType);
+ ClassicAssert.AreEqual(5, test.BlockNumber);
+ ClassicAssert.AreEqual(PLCBlockType.DB, test.BlockType);
test = new PLCBlockName("FC109");
- Assert.AreEqual(109, test.BlockNumber);
- Assert.AreEqual(PLCBlockType.FC, test.BlockType);
+ ClassicAssert.AreEqual(109, test.BlockNumber);
+ ClassicAssert.AreEqual(PLCBlockType.FC, test.BlockType);
test = new PLCBlockName("FB9999");
- Assert.AreEqual(9999, test.BlockNumber);
- Assert.AreEqual(PLCBlockType.FB, test.BlockType);
+ ClassicAssert.AreEqual(9999, test.BlockNumber);
+ ClassicAssert.AreEqual(PLCBlockType.FB, test.BlockType);
test = new PLCBlockName("SDB189");
- Assert.AreEqual(189, test.BlockNumber);
- Assert.AreEqual(PLCBlockType.SDB, test.BlockType);
+ ClassicAssert.AreEqual(189, test.BlockNumber);
+ ClassicAssert.AreEqual(PLCBlockType.SDB, test.BlockType);
test = new PLCBlockName("OB1");
- Assert.AreEqual(1, test.BlockNumber);
- Assert.AreEqual(PLCBlockType.OB, test.BlockType);
+ ClassicAssert.AreEqual(1, test.BlockNumber);
+ ClassicAssert.AreEqual(PLCBlockType.OB, test.BlockType);
try
{
diff --git a/ToolBoxLibUnitTests/TestParameter.cs b/ToolBoxLibUnitTests/TestParameter.cs
index 40c9906e..41b059d1 100644
--- a/ToolBoxLibUnitTests/TestParameter.cs
+++ b/ToolBoxLibUnitTests/TestParameter.cs
@@ -4,6 +4,7 @@
using DotNetSiemensPLCToolBoxLibrary.DataTypes;
using System.Collections.Generic;
using NUnit.Framework;
+using NUnit.Framework.Legacy;
namespace ToolBoxLibUnitTests
{
@@ -32,7 +33,7 @@ public void ParseDatablockWithBooleanInitialValues()
//General Structure must be the same
string Test = DB.ToString().Trim().Replace("\r\n", "\n");
- Assert.AreEqual(File.ReadAllText(dir + "DB3001.awl").Trim().Replace("\r\n", "\n"), DB.ToString().Trim().Replace("\r\n", "\n"));
+ ClassicAssert.AreEqual(File.ReadAllText(dir + "DB3001.awl").Trim().Replace("\r\n", "\n"), DB.ToString().Trim().Replace("\r\n", "\n"));
}
[Test(Description = "Parse Datablock with Real and Integers and some of them, not all of them, defined as having Initial Values")]
@@ -43,7 +44,7 @@ public void ParseDatablockWithRealInitialValues()
//General Structure must be the same
string Test = DB.ToString().Trim().Replace("\r\n", "\n");
- Assert.AreEqual(File.ReadAllText(dir + "DB3002.awl").Trim().Replace("\r\n", "\n"), DB.ToString().Trim().Replace("\r\n", "\n"));
+ ClassicAssert.AreEqual(File.ReadAllText(dir + "DB3002.awl").Trim().Replace("\r\n", "\n"), DB.ToString().Trim().Replace("\r\n", "\n"));
}
[Test(Description = "Parse Datablock with Complex data, containing Arrays with non zero Lower bounds, DateAndTime ans Strings. All of them have initial values. This is one of the most complex Block interfaces to construct")]
@@ -55,7 +56,7 @@ public void ParseDatablockWithComplexInitialValues()
//General Structure must be the same
string Test = DB.ToString().Trim().Replace("\r\n", "\n");
string AWL = File.ReadAllText(dir + "DB3003.awl").Trim().Replace("\r\n", "\n");
- Assert.AreEqual(AWL, DB.ToString().Trim().Replace("\r\n", "\n"));
+ ClassicAssert.AreEqual(AWL, DB.ToString().Trim().Replace("\r\n", "\n"));
}
[Test(Description = "Parse Datablock with multi dimensional Arrays")]
@@ -66,7 +67,7 @@ public void ParseDatablockWithMultiDimensionalArrays()
//General Structure must be the same
string Test = DB.ToString().Trim().Replace("\r\n", "\n");
- Assert.AreEqual(File.ReadAllText(dir + "DB3004.awl").Trim().Replace("\r\n", "\n"), DB.ToString().Trim().Replace("\r\n", "\n"));
+ ClassicAssert.AreEqual(File.ReadAllText(dir + "DB3004.awl").Trim().Replace("\r\n", "\n"), DB.ToString().Trim().Replace("\r\n", "\n"));
}
[Test(Description = "Parse Datablock with two UDT's")]
@@ -77,7 +78,7 @@ public void ParseDatablockWithUDT()
//General Structure must be the same
string Test = DB.ToString().Trim().Replace("\r\n", "\n");
- Assert.AreEqual(File.ReadAllText(dir + "DB3005.awl").Trim().Replace("\r\n", "\n"), DB.ToString().Trim().Replace("\r\n", "\n"));
+ ClassicAssert.AreEqual(File.ReadAllText(dir + "DB3005.awl").Trim().Replace("\r\n", "\n"), DB.ToString().Trim().Replace("\r\n", "\n"));
}
[Test(Description = "Parse Function block with very complex Interface, using all Interface types and Initial Values")]
@@ -89,7 +90,7 @@ public void ParseFunctionBlockComplexInterface()
//Fix up different culture dependent Date conversion
//this might not be optimal, but i dont have any better solution at the moment.
string AWL = File.ReadAllText(dir + "FB3003.awl").Trim().Replace("\r\n", "\n");
- Assert.AreEqual(AWL, DB.ToString().Trim().Replace("\r\n", "\n"));
+ ClassicAssert.AreEqual(AWL, DB.ToString().Trim().Replace("\r\n", "\n"));
}
[Test(Description = "Parse Function block with Multi Instance funcionalities")]
@@ -101,7 +102,7 @@ public void ParseFunctionBlockMultiInstance()
//Fix up different culture dependent Date conversion
//this might not be optimal, but i dont have any better solution at the moment.
string AWL = File.ReadAllText(dir + "FB80.awl").Trim().Replace("\r\n", "\n");
- Assert.AreEqual(AWL, DB.ToString().Trim().Replace("\r\n", "\n"));
+ ClassicAssert.AreEqual(AWL, DB.ToString().Trim().Replace("\r\n", "\n"));
}
[Test(Description = "Parse Function block with BLOCK_XX Parameters and some Multi Instance Parameters")]
@@ -113,7 +114,7 @@ public void ParseBlockParameter()
//Fix up different culture dependent Date conversion
//this might not be optimal, but i dont have any better solution at the moment.
string AWL = File.ReadAllText(dir + "FB3004.awl").Trim().Replace("\r\n", "\n");
- Assert.AreEqual(AWL, DB.ToString().Trim().Replace("\r\n", "\n"));
+ ClassicAssert.AreEqual(AWL, DB.ToString().Trim().Replace("\r\n", "\n"));
}
@@ -127,7 +128,7 @@ public void ParseUnusualDataBlock()
//Fix up different culture dependent Date conversion
//this might not be optimal, but i dont have any better solution at the moment.
string AWL = File.ReadAllText(dir + "DB310.awl").Trim().Replace("\r\n", "\n");
- Assert.AreEqual(AWL, DB.ToString().Trim().Replace("\r\n", "\n"));
+ ClassicAssert.AreEqual(AWL, DB.ToString().Trim().Replace("\r\n", "\n"));
}
[Test(Description = "There are 'Extended' versions for each Parameter type. Parse these")]
@@ -139,7 +140,7 @@ public void ParseParameterTypesExtended()
//Fix up different culture dependent Date conversion
//this might not be optimal, but i dont have any better solution at the moment.
string AWL = File.ReadAllText(dir + "FB41.awl").Trim().Replace("\r\n", "\n");
- Assert.AreEqual(AWL, DB.ToString().Trim().Replace("\r\n", "\n"));
+ ClassicAssert.AreEqual(AWL, DB.ToString().Trim().Replace("\r\n", "\n"));
}
}
}
diff --git a/ToolBoxLibUnitTests/ToolBoxLibUnitTests.csproj b/ToolBoxLibUnitTests/ToolBoxLibUnitTests.csproj
index 36243d5c..6397bcad 100644
--- a/ToolBoxLibUnitTests/ToolBoxLibUnitTests.csproj
+++ b/ToolBoxLibUnitTests/ToolBoxLibUnitTests.csproj
@@ -1,15 +1,17 @@
-
+
false
Library
- net462
+ net8-windows
true
+ true
-
-
+
+
+
diff --git a/WPFToolboxForPLCs/WPFToolboxForSiemensPLCs.csproj b/WPFToolboxForPLCs/WPFToolboxForSiemensPLCs.csproj
index 6f491338..f8f8082a 100644
--- a/WPFToolboxForPLCs/WPFToolboxForSiemensPLCs.csproj
+++ b/WPFToolboxForPLCs/WPFToolboxForSiemensPLCs.csproj
@@ -4,6 +4,7 @@
WinExe
net462
true
+ true
true
@@ -18,7 +19,7 @@
-
+
diff --git a/WPFVarTab/WPFVarTab.csproj b/WPFVarTab/WPFVarTab.csproj
index 93e51aa4..5e457a9b 100644
--- a/WPFVarTab/WPFVarTab.csproj
+++ b/WPFVarTab/WPFVarTab.csproj
@@ -5,6 +5,7 @@
net462
true
true
+ true
x86
@@ -13,8 +14,8 @@
-
-
+
+
diff --git a/appveyor.yml b/appveyor.yml
deleted file mode 100644
index 76b131af..00000000
--- a/appveyor.yml
+++ /dev/null
@@ -1,60 +0,0 @@
-image: Visual Studio 2019
-
-version: 4.0.{build}
-
-branches:
- only:
- - master
-
-dotnet_csproj:
- patch: true
- file: '**\*.csproj'
- version: '{version}'
- package_version: '{version}'
- assembly_version: '{version}'
- file_version: '{version}'
- informational_version: '{version}'
-
-configuration: Debug
-
-install:
- - cmd: choco install dotnetcore-sdk --pre
-
-before_build:
- - cmd.exe /c externalDlls\libnodave\vcwinmake_64.bat
- - cmd.exe /c externalDlls\libnodave\vcwinmake.bat
- - externalDlls\copydlls.bat
- - nuget restore
-
-build:
- project: DotNetSiemensPLCToolBoxLibrary.sln
-
-after_build:
- - 7z a TiaGitHandler.zip %APPVEYOR_BUILD_FOLDER%\TiaGitHandler\bin\Debug\net48\*.*
- - 7z a WPFVarTab.zip %APPVEYOR_BUILD_FOLDER%\WPFVarTab\bin\Debug\net462\*.*
- - 7z a Protokoller.zip %APPVEYOR_BUILD_FOLDER%\DotNetDatenbankProtokollerV2\DotNetSimaticDatabaseProtokollerService\bin\Debug\net462\*.*
- - 7z a S7ToolBox.zip %APPVEYOR_BUILD_FOLDER%\TestProjectFileFunctions\bin\Debug\net48\*.*
-
-artifacts:
- - path: externalDlls\libnodave\libnodave_jfkmod.dll
- name: libnodave_jfkmod.dll
- - path: externalDlls\libnodave\libnodave_jfkmod64.dll
- name: libnodave_jfkmod64.dll
- - path: '**\DotNetSiemensPLCToolBoxLibrary*.*nupkg'
- - path: TiaGitHandler.zip
- name: TiaGitHandler
- - path: S7ToolBox.zip
- name: S7ToolBox
- - path: WPFVarTab.zip
- name: WPFVarTab
- - path: Protokoller.zip
- name: Protokoller
-
-deploy:
- provider: NuGet
- api_key:
- secure: qGLYnLmoAwOz2buRk5Nx5ouhilFDBQf8ktSQ0+EDKPKNUq/xmbfM1kWKt9c1O8YI
- artifact: /.*DotNetProjects\.DotNetSiemensPLCToolBoxLibrary.*nupkg/
-
-
-