public void Test_DecodeVWI_Forward() { uint vli = Mobi.DecodeVWI(new byte[] { 0x99, 0x84, 0x22, 0x11 }, true, out int i); Assert.AreEqual((uint)25, vli); Assert.AreEqual(1, i); }
public void MostCommonWordTest() { const string words = "two one three one three one"; const string expected = "one"; Assert.AreEqual(expected, Mobi.MostCommonWord(words)); }
public void Test_DecodeVWI_Reverse() { uint vli = Mobi.DecodeVWI(new byte[] { 0x99, 0x84, 0x22, 0x11 }, false, out int i); Assert.AreEqual((uint)69905, vli); Assert.AreEqual(3, i); }
public void Test_FormatDate() { Assert.AreEqual(Mobi.FormatDate("12/31/1999"), "1999-12-31"); }
public void Test_CountBits() { int bits = Mobi.CountBits((byte)102); Assert.AreEqual(bits, 4); }
public void Test_EncodeVWI_Forward() { byte[] vli = Mobi.EncodeVWI(69905, true); CollectionAssert.AreEqual(vli, new byte[] { 0x4, 0x22, 0x91 }); }
public void Test_EncodeVWI_Reverse() { byte[] vli = Mobi.EncodeVWI(69905, false); CollectionAssert.AreEqual(vli, new byte[] { 0x84, 0x22, 0x11 }); }