添加项目文件。

This commit is contained in:
Administrator
2026-06-29 14:46:32 +08:00
parent 9a9c508618
commit d9e0324b1d
175 changed files with 17983 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="HslCommunication" Version="12.0.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.1.0" />
<PackageReference Include="MSTest.TestAdapter" Version="2.2.8" />
<PackageReference Include="MSTest.TestFramework" Version="2.2.8" />
<PackageReference Include="coverlet.collector" Version="3.1.2" />
</ItemGroup>
</Project>

31
TestProject1/UnitTest1.cs Normal file
View File

@@ -0,0 +1,31 @@
using HslCommunication.Profinet.Siemens;
namespace TestProject1
{
[TestClass]
public class UnitTest1
{
[TestMethod]
public void TestMethod1()
{
SiemensS7Net plc_Conv = new SiemensS7Net(SiemensPLCS.S1500, "127.0.0.1");
plc_Conv.ConnectTimeOut = 3;
OperateResult res = plc_Conv.ConnectServer();
if (res.IsSuccess)
{
Console.WriteLine(1);
}
else
{
Console.WriteLine(2);
}
Console.ReadKey();
}
}
}

2
TestProject1/Usings.cs Normal file
View File

@@ -0,0 +1,2 @@
global using Microsoft.VisualStudio.TestTools.UnitTesting;
global using HslCommunication;