public static void PacketBlockFlags_FCSLength_Test()
        {
            PacketBlockFlags packetFlagFCSLength = new PacketBlockFlags(480);

            Assert.IsTrue(packetFlagFCSLength.FCSLength);

            PacketBlockFlags packetFlagNoFCSLength = new PacketBlockFlags(128);

            Assert.IsFalse(packetFlagNoFCSLength.FCSLength);
        }
        public static void PacketBlockFlags_CrcError_Test()
        {
            PacketBlockFlags packetCrcError = new PacketBlockFlags(0xFF000000);

            Assert.IsTrue(packetCrcError.CrcError);

            PacketBlockFlags packetFlagNoError = new PacketBlockFlags(128);

            Assert.IsFalse(packetFlagNoError.CrcError);
        }
        public static void PacketBlockFlags_Broadcast_Test()
        {
            PacketBlockFlags packetFlagBroadcast = new PacketBlockFlags(255);

            Assert.IsTrue(packetFlagBroadcast.Broadcast);

            PacketBlockFlags packetFlagNoBroadcast = new PacketBlockFlags(128);

            Assert.IsFalse(packetFlagNoBroadcast.Broadcast);
        }
        public static void PacketBlockFlags_Promisious_Test()
        {
            PacketBlockFlags packetFlagPromisious = new PacketBlockFlags(255);

            Assert.IsTrue(packetFlagPromisious.Promiscuous);

            PacketBlockFlags packetFlagNoPromisious = new PacketBlockFlags(128);

            Assert.IsFalse(packetFlagNoPromisious.Promiscuous);
        }
        public static void PacketBlockFlags_Outbound_Test()
        {
            PacketBlockFlags packetFlagOutbound = new PacketBlockFlags(254);

            Assert.IsTrue(packetFlagOutbound.Outbound);

            PacketBlockFlags packetFlagNoOutbound = new PacketBlockFlags(253);

            Assert.IsFalse(packetFlagNoOutbound.Outbound);
        }
        public static void PacketBlockFlags_Multicast_Test()
        {
            PacketBlockFlags packetFlagMulticast = new PacketBlockFlags(255);

            Assert.IsTrue(packetFlagMulticast.Multicast);

            PacketBlockFlags packetFlagNoMulticast = new PacketBlockFlags(128);

            Assert.IsFalse(packetFlagNoMulticast.Multicast);
        }
        public static void PacketBlockFlags_tartFrameDelimiterError_Test()
        {
            PacketBlockFlags packetStartFrameDelimiterError = new PacketBlockFlags(0xFF000000);

            Assert.IsTrue(packetStartFrameDelimiterError.StartFrameDelimiterError);

            PacketBlockFlags packetFlagNoError = new PacketBlockFlags(128);

            Assert.IsFalse(packetFlagNoError.StartFrameDelimiterError);
        }
        public static void PacketBlockFlags_UnalignedFrameError_Test()
        {
            PacketBlockFlags packetUnalignedFrameError = new PacketBlockFlags(0xFF000000);

            Assert.IsTrue(packetUnalignedFrameError.UnalignedFrameError);

            PacketBlockFlags packetFlagNoError = new PacketBlockFlags(128);

            Assert.IsFalse(packetFlagNoError.UnalignedFrameError);
        }
        public static void PacketBlockFlags_WrongInterFrameGapError_Test()
        {
            PacketBlockFlags packetWrongInterFrameGapError = new PacketBlockFlags(0xFF000000);

            Assert.IsTrue(packetWrongInterFrameGapError.WrongInterFrameGapError);

            PacketBlockFlags packetFlagNoError = new PacketBlockFlags(128);

            Assert.IsFalse(packetFlagNoError.WrongInterFrameGapError);
        }
        public static void PacketBlockFlags_Inbound_Test()
        {
            PacketBlockFlags packetFlagInbound = new PacketBlockFlags(511);

            Assert.IsTrue(packetFlagInbound.Inbound);

            PacketBlockFlags packetFlagNoInbound = new PacketBlockFlags(512);

            Assert.IsFalse(packetFlagNoInbound.Inbound);
        }
Beispiel #11
0
        public override bool Equals(Object obj)
        {
            if (obj == null || GetType() != obj.GetType())
            {
                return(false);
            }

            PacketBlockFlags p = (PacketBlockFlags)obj;

            return(this.Flag == p.Flag);
        }