mirror of
https://github.com/evopro-ag/Sharp7Reactive.git
synced 2025-12-15 19:32:53 +00:00
26 lines
639 B
C#
26 lines
639 B
C#
using NUnit.Framework;
|
|
using Shouldly;
|
|
|
|
namespace Sharp7.Rx.Tests.ValueConverterTests;
|
|
|
|
[TestFixture]
|
|
internal class ConvertBothWays : ConverterTestBase
|
|
{
|
|
[TestCaseSource(nameof(GetValidTestCases))]
|
|
public void Convert(ConverterTestCase tc)
|
|
{
|
|
//Arrange
|
|
var buffer = new byte[tc.VariableAddress.BufferLength];
|
|
|
|
var write = CreateWriteMethod(tc);
|
|
var read = CreateReadMethod(tc);
|
|
|
|
//Act
|
|
write.Invoke(null, [buffer, tc.Value, tc.VariableAddress]);
|
|
var result = read.Invoke(null, [buffer, tc.VariableAddress]);
|
|
|
|
//Assert
|
|
result.ShouldBe(tc.Value);
|
|
}
|
|
}
|