Files
MewtocolNet/MewtocolTests/TestRegisterInterface.cs
2023-07-21 18:23:20 +02:00

52 lines
1.2 KiB
C#

using MewtocolNet;
using MewtocolNet.Registers;
using Xunit;
using Xunit.Abstractions;
namespace MewtocolTests {
public class TestRegisterInterface {
private readonly ITestOutputHelper output;
public TestRegisterInterface(ITestOutputHelper output) {
this.output = output;
}
[Fact(DisplayName = "Non allowed Struct Address (Overflow address)")]
public void OverFlowStructRegister() {
var ex = Assert.Throws<NotSupportedException>(() => {
new StructRegister<short>(100000, 2);
});
output.WriteLine(ex.Message.ToString());
}
[Fact(DisplayName = "Non allowed Boolean Address (Overflow address )")]
public void OverFlowBoolRegister() {
var ex1 = Assert.Throws<NotSupportedException>(() => {
new BoolRegister(SingleBitPrefix.R, _areaAdress: 512);
});
output.WriteLine(ex1.Message.ToString());
var ex2 = Assert.Throws<NotSupportedException>(() => {
new BoolRegister(SingleBitPrefix.X, _areaAdress: 110);
});
output.WriteLine(ex2.Message.ToString());
}
}
}