Exemple #1
0
 public void CheckToByteArray()
 {
     // arrange
     //     0           128        48           0         0         0         0         4
     // 0000|0000|10   00|0000|0011|   0000|0000|0000|0000|0000|0000|0000|0000|0000|0000|0100
     //      2               3                                4
     var token = new InstrumentationLib.Token(2, 3, 4);
     // act
     byte[] ba = token.ToByteArray();
     // assert
     Assert.AreEqual(0, ba[7]);
     Assert.AreEqual(128, ba[6]);
     Assert.AreEqual(48, ba[5]);
     Assert.AreEqual(0, ba[4]);
     Assert.AreEqual(0, ba[3]);
     Assert.AreEqual(0, ba[2]);
     Assert.AreEqual(0, ba[1]);
     Assert.AreEqual(4, ba[0]);
 }
Exemple #2
0
 public void CheckTokenCreationWithBadLength()
 {
     // arrange
     var token = new InstrumentationLib.Token(2, 3, 456);
     byte[] ba = token.ToByteArray();
     // act
     var token2 = new InstrumentationLib.Token(ba, 3);
     // assert
 }