public void ToBinary_Test()
        {
            // arrange
            var    utils       = new Ipv4AddressUtils();
            ushort firstOctet  = 192;
            ushort secondOctet = 0;
            ushort thirdOctet  = 255;
            ushort fourthOctet = 127;
            var    expected    = new List <bool>(utils.GetSingleOctetBinaryFromDecimal(firstOctet));

            expected.AddRange(utils.GetSingleOctetBinaryFromDecimal(secondOctet));
            expected.AddRange(utils.GetSingleOctetBinaryFromDecimal(thirdOctet));
            expected.AddRange(utils.GetSingleOctetBinaryFromDecimal(fourthOctet));
            var address = new Ipv4Address(192, 0, 255, 127);

            // act
            var result = address.ToBinary();

            // assert
            Assert.NotNull(result);
            Assert.True(expected.SequenceEqual(result));
        }
        public void Constructor_FromBoolArray()
        {
            // arrange
            var    utils       = new Ipv4AddressUtils();
            ushort firstOctet  = 192;
            ushort secondOctet = 0;
            ushort thirdOctet  = 255;
            ushort fourthOctet = 127;
            var    input       = new List <bool>(utils.GetSingleOctetBinaryFromDecimal(firstOctet));

            input.AddRange(utils.GetSingleOctetBinaryFromDecimal(secondOctet));
            input.AddRange(utils.GetSingleOctetBinaryFromDecimal(thirdOctet));
            input.AddRange(utils.GetSingleOctetBinaryFromDecimal(fourthOctet));

            // act
            Ipv4Address address = new Ipv4Address(input.ToArray());

            // assert
            Assert.NotNull(address);
            Assert.AreEqual(firstOctet, address.FirstOctet);
            Assert.AreEqual(secondOctet, address.SecondOctet);
            Assert.AreEqual(thirdOctet, address.ThirdOctet);
            Assert.AreEqual(fourthOctet, address.FourthOctet);
        }