-
Notifications
You must be signed in to change notification settings - Fork 1
Support for .NET 10.0. #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,8 @@ | ||
| <Project Sdk="Microsoft.NET.Sdk"> | ||
| <PropertyGroup> | ||
| <!-- common nuget configuration see Directory.Build.props--> | ||
| <TargetFrameworks>net471;net8.0-windows</TargetFrameworks> | ||
| <Version>5.0.0.0</Version> | ||
| <TargetFrameworks>net10.0-windows;net8.0-windows</TargetFrameworks> | ||
| <Version>5.2.0</Version> | ||
|
|
||
| <Product>Mbc.Pcs.Net.Alarm.Service</Product> | ||
|
|
||
|
|
@@ -13,16 +13,15 @@ | |
| <ItemGroup> | ||
| <!-- Include Mbc.Pcs.Net.Alarm.Mediator files into the package--> | ||
| <!-- $(TargetPlatformIdentifier) == windows; $(TargetPlatformVersion) == 7.0--> | ||
| <Content Include="$(OutputPath)net471/Mbc.Pcs.Net.Alarm.Mediator.exe" PackagePath="lib/net471" Visible="false" /> | ||
| <Content Include="$(OutputPath)net8.0-windows/Mbc.Pcs.Net.Alarm.Mediator.exe" PackagePath="lib/net8.0-windows7.0" Visible="false" /> | ||
| <Content Include="$(OutputPath)net10.0-windows/Mbc.Pcs.Net.Alarm.Mediator.exe" PackagePath="lib/net10.0-windows7.0" Visible="false" /> | ||
|
Comment on lines
16
to
+17
|
||
| <PackageReference Include="Mbc.Pcs.Net.TwinCat.EventLog" Version="1.0.2" /> | ||
| <PackageReference Include="Microsoft.Extensions.CommandLineUtils" Version="1.1.1" /> | ||
| </ItemGroup> | ||
|
|
||
| <ItemGroup> | ||
| <PackageReference Include="Newtonsoft.Json" Version="13.0.3" /> | ||
| <PackageReference Include="NLog" Version="4.6.8" /> | ||
| <PackageReference Include="System.Text.RegularExpressions" Version="4.3.1" /> | ||
| </ItemGroup> | ||
|
|
||
| <ItemGroup> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,127 @@ | ||
| using System; | ||
| using System.IO; | ||
| using System.Linq; | ||
| using AwesomeAssertions; | ||
| using Mbc.Pcs.Net.DataRecorder.Hdf5Utils; | ||
| using Mbc.Pcs.Net.DataRecorder.Test.Hdf5Utils.Utils; | ||
| using Xunit; | ||
|
|
||
| namespace Mbc.Pcs.Net.DataRecorder.Test.Hdf5Utils | ||
| { | ||
| [Collection("HDF5")] | ||
| public class H5AttributeTest : IDisposable | ||
| { | ||
| private readonly H5File _h5File; | ||
|
|
||
| public H5AttributeTest(Hdf5LibFixture hdf5Lib) | ||
| { | ||
| var file = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); | ||
| File.Delete(file); | ||
| _h5File = new H5File(file, H5File.Flags.CreateOnly); | ||
| } | ||
|
|
||
| public void Dispose() | ||
| { | ||
| _h5File.Dispose(); | ||
| } | ||
|
|
||
| [Fact] | ||
| public void WriteAndReadStringAttribute() | ||
| { | ||
| // Arrange | ||
| var attribute = new H5Attribute(_h5File); | ||
|
|
||
| // Act | ||
| attribute.Write("foo", "bar"); | ||
| var attrValue = attribute.ReadString("foo"); | ||
|
|
||
| // Assert | ||
| attrValue.Should().Be("bar"); | ||
| } | ||
|
|
||
| [Fact] | ||
| public void WriteAndReadIntAttribute() | ||
| { | ||
| // Arrange | ||
| var attribute = new H5Attribute(_h5File); | ||
|
|
||
| // Act | ||
| attribute.Write("foo", 42); | ||
| var attrValue = attribute.ReadInt("foo"); | ||
|
|
||
| // Assert | ||
| attrValue.Should().Be(42); | ||
| } | ||
|
|
||
| [Fact] | ||
| public void WriteAndReadDoubleAttribute() | ||
| { | ||
| // Arrange | ||
| var attribute = new H5Attribute(_h5File); | ||
|
|
||
| // Act | ||
| attribute.Write("foo", 42d); | ||
| var attrValue = attribute.ReadDouble("foo"); | ||
|
|
||
| // Assert | ||
| attrValue.Should().Be(42d); | ||
| } | ||
|
|
||
| [Fact] | ||
| public void WriteShortAndReadIntAttribute() | ||
| { | ||
| // Arrange | ||
| var attribute = new H5Attribute(_h5File); | ||
|
|
||
| // Act | ||
| attribute.Write("foo", (ushort)60000); | ||
| var attrValue = attribute.ReadInt("foo"); | ||
|
|
||
| // Assert | ||
| attrValue.Should().Be(60000); | ||
| } | ||
|
|
||
| [Fact] | ||
| public void ReadObjectAttribute() | ||
| { | ||
| // Arrange | ||
| var attribute = new H5Attribute(_h5File); | ||
| attribute.Write("foo", "bar"); | ||
|
|
||
| // Act | ||
| var attrValue = attribute.Read("foo"); | ||
|
|
||
| // Assert | ||
| attrValue.Should().BeAssignableTo<string>().Which.Should().Be("bar"); | ||
| } | ||
|
|
||
| [Fact] | ||
| public void ListAttributeNames() | ||
| { | ||
| // Arrange | ||
| var attribute = new H5Attribute(_h5File); | ||
| attribute.Write("foo", "bar"); | ||
| attribute.Write("baz", "bar"); | ||
|
|
||
| // Act | ||
| var names = attribute.GetAttributeNames().ToList(); | ||
|
|
||
| // Assert | ||
| names.Should().BeEquivalentTo("foo", "baz"); | ||
| } | ||
|
|
||
| [Fact] | ||
| public void ReWriteAttribute() | ||
| { | ||
| // Arrange | ||
| var attribute = new H5Attribute(_h5File); | ||
| attribute.Write("foo", 1); | ||
|
|
||
| // Act | ||
| attribute.Write("foo", 2); | ||
|
|
||
| // Assert | ||
| attribute.ReadInt("foo").Should().Be(2); | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment contains a typo: "recconection" should be "reconnection".