Exemplo n.º 1
0
 public void TestDisplayBytes()
 {
     Assert.AreEqual("00000000 11111111", BitDisplay.BytesToString(new byte[] { 255, 0 }));
     Assert.AreEqual("00000001 11111111", BitDisplay.BytesToString(new byte[] { 255, 1 }));
     Assert.AreEqual("10000001 11111111", BitDisplay.BytesToString(new byte[] { 255, 128 | 1 }));
     Assert.AreEqual("10000001 11111111 00000001", BitDisplay.BytesToString(new byte[] { 1, 255, 128 | 1 }));
     Assert.AreEqual("10000001 11111111 00000010", BitDisplay.BytesToString(new byte[] { 1 << 1, 255, 128 | 1 }));
     Assert.AreEqual("01000000 11111111 00000010", BitDisplay.BytesToString(new byte[] { 1 << 1, 255, (128 | 1) >> 1 }));
 }
Exemplo n.º 2
0
 public static void AssertPattern(string pattern, byte[] value)
 {
     Assert.AreEqual(pattern, BitDisplay.BytesToString(value));
 }