public void ForSByte() { for (sbyte s = sbyte.MinValue; s < sbyte.MaxValue; s++) { var b = (byte)s; var bits = b.ToBinaryString(); b = (byte)(s.FlipBits()); var flip = b.ToBinaryString(); flip = flip[0] + string.Join("", flip.Skip(1).Reverse()); Assert.Equal(bits, flip); } }