using Xunit; using MewtocolNet; using MewtocolNet.Registers; using System.Diagnostics; using Xunit.Abstractions; using System.Collections; namespace MewtocolTests { public class TestComProtocol { private readonly ITestOutputHelper output; public TestComProtocol (ITestOutputHelper output) { this.output = output; } [Fact(DisplayName = "Numeric register protocol identifiers")] public void NumericRegisterMewtocolIdentifiers () { List registers = new List { new NRegister(50), new NRegister(50), new NRegister(50), new NRegister(50), new NRegister(50), }; List expcectedIdents = new List { "D0005000050", //single word register "D0005000050", //single word register "D0005000051", //double word register "D0005000051", //double word register "D0005000051", //double word register "D0005000051", //double word register }; //test mewtocol idents for (int i = 0; i < registers.Count; i++) { Register? reg = registers[i]; string expect = expcectedIdents[i]; Assert.Equal(expect, reg.BuildMewtocolIdent()); } } } }