예제 #1
0
 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);
 }
예제 #2
0
 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);
 }
예제 #3
0
 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);
 }
예제 #4
0
 public void FlagsTest()
 {
     BitString bs = new BitString(3, 0);
     bs[0] = true;
     bs[2] = true;
     Assert.AreEqual(bs.Flags, 160ul);
 }
예제 #5
0
        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]);
        }
예제 #6
0
 public void LengthTest()
 {
     BitString bs = new BitString(3, 32 + 128);
     Assert.AreEqual(bs.Length, 3);
 }
예제 #7
0
 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);
 }
예제 #8
0
 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]);
 }
예제 #9
0
 public void FlagsTest1()
 {
     BitString<TestBitstring> bs = new BitString<TestBitstring>(TestBitstring.Flag1, TestBitstring.Flag3);
     Assert.AreEqual(bs.Flags, 160ul);
 }