public void Set() { var tcpSegment = new TCPSegment { Bytes = new Byte[32] }; tcpSegment.FlagFIN = true; tcpSegment.GetByte(13).Should().Be(0b_0000_0001); tcpSegment.FlagFIN = false; tcpSegment.GetByte(13).Should().Be(0b_0000_0000); }
public void Set(Byte input) { var tcpSegment = new TCPSegment { Bytes = new Byte[32] }; tcpSegment.SetByte(12, 0x05); tcpSegment.HeaderLength = input; tcpSegment.HeaderLength.Should().Be(input); tcpSegment.GetByte(12).Should().Be((Byte)(input << 4 | (0x45 & 0x0F))); }