public void BitStringConstructorTest() { BitString bs = new BitString(3, 128 + 32); Assert.AreEqual(bs.Length, 3); Assert.AreEqual(bs[0], true); Assert.AreEqual(bs[1], false); Assert.AreEqual(bs[2], true); }
public void BitStringConstructorTest1() { BitString<TestBitstring> bs = new BitString<TestBitstring>(TestBitstring.Flag1, TestBitstring.Flag3); Assert.AreEqual(bs.Length, 3); Assert.AreEqual(bs[TestBitstring.Flag1], true); Assert.AreEqual(bs[TestBitstring.Flag2], false); Assert.AreEqual(bs[TestBitstring.Flag3], true); }
public void BitStringConstructorTest2() { ulong flags = 128 + 32; BitString<TestBitstring> bs = new BitString<TestBitstring>(flags); Assert.AreEqual(bs.Length, 3); Assert.AreEqual(bs[TestBitstring.Flag1], true); Assert.AreEqual(bs[TestBitstring.Flag2], false); Assert.AreEqual(bs[TestBitstring.Flag3], true); }
public void FlagsTest() { BitString bs = new BitString(3, 0); bs[0] = true; bs[2] = true; Assert.AreEqual(bs.Flags, 160ul); }
public void op_ImplicitTest() { BitString<TestBitstring> bs = new BitString<TestBitstring>(128 + 32); BitString bs2 = bs; Assert.AreEqual(bs.Length, bs2.Length); Assert.AreEqual(true, bs2[0]); Assert.AreEqual(false, bs2[1]); Assert.AreEqual(true, bs2[2]); }
public void LengthTest() { BitString bs = new BitString(3, 32 + 128); Assert.AreEqual(bs.Length, 3); }
public void ItemTest2() { BitString<TestBitstring> bs = new BitString<TestBitstring>(); bs[TestBitstring.Flag1] = true; bs[TestBitstring.Flag2] = false; bs[TestBitstring.Flag3] = true; Assert.AreEqual(bs.Flags, 160ul); }
public void ItemTest() { BitString bs = new BitString(3, 32 + 128); Assert.AreEqual(true, bs[0]); Assert.AreEqual(false, bs[1]); Assert.AreEqual(true, bs[2]); }
public void FlagsTest1() { BitString<TestBitstring> bs = new BitString<TestBitstring>(TestBitstring.Flag1, TestBitstring.Flag3); Assert.AreEqual(bs.Flags, 160ul); }