public void TestIt() { Catch(() => { IPAddressHelper.GetAddressValue(null); }).ShouldBeOfType <ArgumentNullException>(); Catch(() => { IPAddressHelper.GetAddressValue(new byte[0]); }).ShouldBeOfType <ArgumentException>(); Catch(() => { IPAddressHelper.GetAddressValue(new byte[] { 0, 1 }); }).ShouldBeOfType <ArgumentException>(); var addressValue = IPAddressHelper.GetAddressValue(new byte[] { 0x11, 0x22, 0x33, 0x44 }); addressValue.ShouldEqual(0x11223344); }