示例#1
0
        public virtual void FlipRangeFalseTest()
        {
            int[]   set     = { 1, 2, 3, 7 };
            IBitset testSet = CreateSetFromIndices(set, 8);

            testSet.Flip(2, 4);
            bool expected = false;
            bool result   = testSet.Get(3);

            Assert.AreEqual(expected, result);
        }
示例#2
0
        public void FlipRangeTrueTest()
        {
            int[]   set     = { 1, 2, 3, 7 };
            IBitset testSet = CreateSetFromIndices(set, 8);

            testSet.Flip(4, 6);
            bool expected = true;
            bool result   = testSet.Get(5);

            Assert.Equal(expected, result);
        }
示例#3
0
        public virtual void FlipTrueTest()
        {
            int[]   set     = { 1, 2, 3, 5 };
            IBitset testSet = CreateSetFromIndices(set, 6);

            testSet.Flip(4);
            bool expected = true;
            bool result   = testSet.Get(4);

            Assert.AreEqual(expected, result);
        }
示例#4
0
        public void FlipFalseTest()
        {
            int[]   set     = { 1, 2, 3, 5 };
            IBitset testSet = CreateSetFromIndices(set, 6);

            testSet.Flip(2);
            bool expected = false;
            bool result   = testSet.Get(2);

            Assert.Equal(expected, result);
        }
示例#5
0
        public virtual void GetHashCodeNotEqualTest()
        {
            int[]   set          = SetGenerator.GetRandomArray(TEST_SET_LENGTH);
            IBitset testSet      = CreateSetFromIndices(set, TEST_SET_LENGTH);
            IBitset otherTestSet = CreateSetFromIndices(set, TEST_SET_LENGTH);

            otherTestSet.Flip(SetGenerator.GetRandomArray(1)[0]);
            int hash      = testSet.GetHashCode();
            int otherHash = otherTestSet.GetHashCode();

            Assert.AreNotEqual(hash, otherHash);
        }