private void TestSiblings(List<IPAddress> expectedAddresses, IPAddress currentIp, NetMask mask, SiblingOptions options = SiblingOptions.IncludeAll) { var enumerable = currentIp.GetSiblings(mask, options); var siblingCount = mask.GetSiblingCount(options); Assert.AreEqual(expectedAddresses.Count, siblingCount); int i = 0; foreach (var t in enumerable) { var expected = expectedAddresses[i++]; Assert.AreEqual(expected, t); } Assert.AreEqual(expectedAddresses.Count, i); }