Exemplo n.º 1
0
        /// <summary> Compare a subset against the corresponding portion of the test pattern</summary>
        private void  DoTestSubset(int start, int end)
        {
            BitVector full   = CreateSubsetTestVector();
            BitVector subset = full.Subset(start, end);

            Assert.AreEqual(end - start, subset.Size());
            int count = 0;

            for (int i = start, j = 0; i < end; i++, j++)
            {
                if (subsetPattern[i] == 1)
                {
                    count++;
                    Assert.IsTrue(subset.Get(j));
                }
                else
                {
                    Assert.IsFalse(subset.Get(j));
                }
            }
            Assert.AreEqual(count, subset.Count());
        }