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); }
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); }
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); }
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); }
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); }