示例#1
0
        void CheckBasic(IBitmap b)
        {
            b[1, 1] = true;
            b[2, 2] = false;

            Assert.True(b[1, 1]);
            Assert.False(b[2, 2]);
            Assert.True(b[new VectorInt2(1, 1)]);
            Assert.False(b[new VectorInt2(2, 2)]);

            Assert.Equal(1, b.Count());

            var asList = b.ForEach().ToList();

            Assert.Contains((new VectorInt2(1, 1), true), asList);
            Assert.Contains((new VectorInt2(2, 2), false), asList);

            var hash = b.GetHashCode();

            Assert.NotEqual(0, hash);

            var clone = new Bitmap(b);

            Assert.Equal(b, clone);
            Assert.True(b.Equals(clone));
            Assert.Equal(0, b.CompareTo(clone));

            Assert.Equal(b, b.BitwiseOR(b));
            Assert.Equal(b, b.BitwiseAND(b));

            Assert.True(b.SizeInBytes() > 0);
        }