예제 #1
0
            public static void PacketBlockFlags_Inbound_Test()
            {
                PacketBlockFlags packetFlagInbound = new PacketBlockFlags(511);
                Assert.IsTrue(packetFlagInbound.Inbound);

                PacketBlockFlags packetFlagNoInbound = new PacketBlockFlags(512);
                Assert.IsFalse(packetFlagNoInbound.Inbound);
            }
예제 #2
0
            public static void PacketBlockFlags_Broadcast_Test()
            {
                PacketBlockFlags packetFlagBroadcast = new PacketBlockFlags(255);
                Assert.IsTrue(packetFlagBroadcast.Broadcast);

                PacketBlockFlags packetFlagNoBroadcast = new PacketBlockFlags(128);
                Assert.IsFalse(packetFlagNoBroadcast.Broadcast);
            }
예제 #3
0
            public static void PacketBlockFlags_Multicast_Test()
            {
                PacketBlockFlags packetFlagMulticast = new PacketBlockFlags(255);
                Assert.IsTrue(packetFlagMulticast.Multicast);

                PacketBlockFlags packetFlagNoMulticast = new PacketBlockFlags(128);
                Assert.IsFalse(packetFlagNoMulticast.Multicast);
            }
예제 #4
0
            public static void PacketBlockFlags_Promisious_Test()
            {
                PacketBlockFlags packetFlagPromisious = new PacketBlockFlags(255);
                Assert.IsTrue(packetFlagPromisious.Promiscuous);

                PacketBlockFlags packetFlagNoPromisious = new PacketBlockFlags(128);
                Assert.IsFalse(packetFlagNoPromisious.Promiscuous);
            }
예제 #5
0
            public static void PacketBlockFlags_FCSLength_Test()
            {
                PacketBlockFlags packetFlagFCSLength = new PacketBlockFlags(480);
                Assert.IsTrue(packetFlagFCSLength.FCSLength);

                PacketBlockFlags packetFlagNoFCSLength = new PacketBlockFlags(128);
                Assert.IsFalse(packetFlagNoFCSLength.FCSLength);
            }
예제 #6
0
            public static void PacketBlockFlags_Outbound_Test()
            {
                PacketBlockFlags packetFlagOutbound = new PacketBlockFlags(254);
                Assert.IsTrue(packetFlagOutbound.Outbound);

                PacketBlockFlags packetFlagNoOutbound = new PacketBlockFlags(253);
                Assert.IsFalse(packetFlagNoOutbound.Outbound);
            }
예제 #7
0
            public static void PacketBlockFlags_UnalignedFrameError_Test()
            {
                PacketBlockFlags packetUnalignedFrameError = new PacketBlockFlags(0xFF000000);

                Assert.IsTrue(packetUnalignedFrameError.UnalignedFrameError);

                PacketBlockFlags packetFlagNoError = new PacketBlockFlags(128);

                Assert.IsFalse(packetFlagNoError.UnalignedFrameError);
            }
예제 #8
0
            public static void PacketBlockFlags_Promisious_Test()
            {
                PacketBlockFlags packetFlagPromisious = new PacketBlockFlags(255);

                Assert.IsTrue(packetFlagPromisious.Promiscuous);

                PacketBlockFlags packetFlagNoPromisious = new PacketBlockFlags(128);

                Assert.IsFalse(packetFlagNoPromisious.Promiscuous);
            }
예제 #9
0
            public static void PacketBlockFlags_Broadcast_Test()
            {
                PacketBlockFlags packetFlagBroadcast = new PacketBlockFlags(255);

                Assert.IsTrue(packetFlagBroadcast.Broadcast);

                PacketBlockFlags packetFlagNoBroadcast = new PacketBlockFlags(128);

                Assert.IsFalse(packetFlagNoBroadcast.Broadcast);
            }
예제 #10
0
            public static void PacketBlockFlags_Multicast_Test()
            {
                PacketBlockFlags packetFlagMulticast = new PacketBlockFlags(255);

                Assert.IsTrue(packetFlagMulticast.Multicast);

                PacketBlockFlags packetFlagNoMulticast = new PacketBlockFlags(128);

                Assert.IsFalse(packetFlagNoMulticast.Multicast);
            }
예제 #11
0
            public static void PacketBlockFlags_Outbound_Test()
            {
                PacketBlockFlags packetFlagOutbound = new PacketBlockFlags(254);

                Assert.IsTrue(packetFlagOutbound.Outbound);

                PacketBlockFlags packetFlagNoOutbound = new PacketBlockFlags(253);

                Assert.IsFalse(packetFlagNoOutbound.Outbound);
            }
예제 #12
0
            public static void PacketBlockFlags_SymbolError_Test()
            {
                PacketBlockFlags packetSymbolError = new PacketBlockFlags(0xFF000000);

                Assert.IsTrue(packetSymbolError.SymbolError);

                PacketBlockFlags packetFlagNoError = new PacketBlockFlags(128);

                Assert.IsFalse(packetFlagNoError.SymbolError);
            }
예제 #13
0
            public static void PacketBlockFlags_PreambleError_Test()
            {
                PacketBlockFlags packetPreambleError = new PacketBlockFlags(0xFF000000);

                Assert.IsTrue(packetPreambleError.PreambleError);

                PacketBlockFlags packetFlagNoError = new PacketBlockFlags(128);

                Assert.IsFalse(packetFlagNoError.PreambleError);
            }
예제 #14
0
            public static void PacketBlockFlags_Inbound_Test()
            {
                PacketBlockFlags packetFlagInbound = new PacketBlockFlags(511);

                Assert.IsTrue(packetFlagInbound.Inbound);

                PacketBlockFlags packetFlagNoInbound = new PacketBlockFlags(512);

                Assert.IsFalse(packetFlagNoInbound.Inbound);
            }
예제 #15
0
            public static void PacketBlockFlags_tartFrameDelimiterError_Test()
            {
                PacketBlockFlags packetStartFrameDelimiterError = new PacketBlockFlags(0xFF000000);

                Assert.IsTrue(packetStartFrameDelimiterError.StartFrameDelimiterError);

                PacketBlockFlags packetFlagNoError = new PacketBlockFlags(128);

                Assert.IsFalse(packetFlagNoError.StartFrameDelimiterError);
            }
예제 #16
0
            public static void PacketBlockFlags_FCSLength_Test()
            {
                PacketBlockFlags packetFlagFCSLength = new PacketBlockFlags(480);

                Assert.IsTrue(packetFlagFCSLength.FCSLength);

                PacketBlockFlags packetFlagNoFCSLength = new PacketBlockFlags(128);

                Assert.IsFalse(packetFlagNoFCSLength.FCSLength);
            }
예제 #17
0
            public static void PacketBlockFlags_WrongInterFrameGapError_Test()
            {
                PacketBlockFlags packetWrongInterFrameGapError = new PacketBlockFlags(0xFF000000);

                Assert.IsTrue(packetWrongInterFrameGapError.WrongInterFrameGapError);

                PacketBlockFlags packetFlagNoError = new PacketBlockFlags(128);

                Assert.IsFalse(packetFlagNoError.WrongInterFrameGapError);
            }
예제 #18
0
        public override bool Equals(Object obj)
        {
            if (obj == null || GetType() != obj.GetType())
            {
                return(false);
            }

            PacketBlockFlags p = (PacketBlockFlags)obj;

            return(this.Flag == p.Flag);
        }
예제 #19
0
            public static void PacketBlockFlags_PacketTooLongError_Test()
            {
                PacketBlockFlags packetTooLongError = new PacketBlockFlags(0xFF000000);
                Assert.IsTrue(packetTooLongError.PacketTooLongError);

                PacketBlockFlags packetFlagNoError = new PacketBlockFlags(128);
                Assert.IsFalse(packetFlagNoError.PacketTooLongError);
            }
예제 #20
0
            public static void PacketBlockFlags_UnalignedFrameError_Test()
            {
                PacketBlockFlags packetUnalignedFrameError = new PacketBlockFlags(0xFF000000);
                Assert.IsTrue(packetUnalignedFrameError.UnalignedFrameError);

                PacketBlockFlags packetFlagNoError = new PacketBlockFlags(128);
                Assert.IsFalse(packetFlagNoError.UnalignedFrameError);
            }
예제 #21
0
 public EnchantedPacketOption(string Comment = null, PacketBlockFlags PacketFlag = null, long? DropCount = null, HashBlock Hash = null) 
 {
     this.Comment = Comment;
     this.PacketFlag = PacketFlag;
     this.DropCount = DropCount;
     this.Hash = Hash;
 }
예제 #22
0
            public static void PacketBlockFlags_tartFrameDelimiterError_Test()
            {
                PacketBlockFlags packetStartFrameDelimiterError = new PacketBlockFlags(0xFF000000);
                Assert.IsTrue(packetStartFrameDelimiterError.StartFrameDelimiterError);

                PacketBlockFlags packetFlagNoError = new PacketBlockFlags(128);
                Assert.IsFalse(packetFlagNoError.StartFrameDelimiterError);
            }
예제 #23
0
 public PacketOption(string Comment = null, PacketBlockFlags PacketFlag = null, HashBlock Hash = null)
 {
     this.Comment = Comment;
     this.PacketFlag = PacketFlag;
     this.Hash = Hash;
 }
예제 #24
0
            public static void PacketBlockFlags_WrongInterFrameGapError_Test()
            {
                PacketBlockFlags packetWrongInterFrameGapError = new PacketBlockFlags(0xFF000000);
                Assert.IsTrue(packetWrongInterFrameGapError.WrongInterFrameGapError);

                PacketBlockFlags packetFlagNoError = new PacketBlockFlags(128);
                Assert.IsFalse(packetFlagNoError.WrongInterFrameGapError);
            }