예제 #1
0
 public void ConvertTest()
 {
     SignedDecimalConverter target = new SignedDecimalConverter(); 
     byte[] data = new byte[] { 0x9f, 0x01 }; 
     string expected = "[ -97, 1, ]"; 
     string actual;
     actual = target.Convert(data);
     Assert.AreEqual(expected, actual);
 }
예제 #2
0
 public void ConvertBackTest()
 {
     SignedDecimalConverter target = new SignedDecimalConverter();
     string source = "[ -97, 1 ]"; 
     byte[] expected = new byte[] {0x9F, 0x01}; 
     byte[] actual;
     actual = target.ConvertBack(source);
     Assert.AreEqual(actual.Length, 2);
     Assert.AreEqual(expected[0], actual[0]);
     Assert.AreEqual(expected[1], actual[1]);
 }