mirror of
https://github.com/UtilitechAS/amsreader-firmware.git
synced 2026-03-09 04:29:42 +00:00
Testing new Kamstrup format
This commit is contained in:
@@ -8,6 +8,7 @@ namespace HanDebuggerTest
|
||||
{
|
||||
[TestClass]
|
||||
[DeploymentItem(@"SampleData.txt")]
|
||||
[DeploymentItem(@"Kamstrup228.txt")]
|
||||
[DeploymentItem("Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll")]
|
||||
public class ReaderTest
|
||||
{
|
||||
@@ -33,5 +34,16 @@ namespace HanDebuggerTest
|
||||
Assert.IsTrue(reader.IsValid(), $"Data is not valid (Line #{i + 1}): {sample}");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[TestMethod]
|
||||
public void TestKamstrup228()
|
||||
{
|
||||
var text = File.ReadAllText("Kamstrup228.txt");
|
||||
byte[] bytes = text.Trim().Split(' ').Select(v => (byte)int.Parse(v, System.Globalization.NumberStyles.HexNumber)).ToArray();
|
||||
var reader = new Reader(bytes);
|
||||
Assert.IsTrue(reader.IsValid(), "Data is not valid");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user