public void ValidParserTest() { void Check(string address, int area, int line, int participant) { var pa = new KnxIndividualAddress(address); Assert.AreEqual(true, pa.IsValid()); Assert.AreEqual(area, pa.Area); Assert.AreEqual(line, pa.Line); Assert.AreEqual(participant, pa.Participant); Assert.AreEqual(true, pa.Equals(area, line, participant)); Assert.AreEqual(true, pa.Equals($"{area}.{line}.{participant}")); } Check("0.0.1", 0, 0, 1); Check("15.15.255", 15, 15, 255); Check("10.10.10", 10, 10, 10); }
public void ValidTest() { void Check(int area, int line, int participant) { var pa = new KnxIndividualAddress(area, line, participant); Assert.AreEqual(true, pa.IsValid()); Assert.AreEqual(area, pa.Area); Assert.AreEqual(line, pa.Line); Assert.AreEqual(participant, pa.Participant); Assert.AreEqual(true, pa.Equals(area, line, participant)); Assert.AreEqual(true, pa.Equals($"{area}.{line}.{participant}")); } Check(0, 0, 1); Check(15, 15, 255); Check(10, 10, 10); }