コード例 #1
0
ファイル: TestBoolMatrix.cs プロジェクト: unhammer/gimp-sharp
 public void GenerateOk()
 {
     const int width = 43;
       const int height = 29;
       var b = new BoolMatrix(width, height);
       var c = b.Generate(1);
       Assert.IsNotNull(c);
 }
コード例 #2
0
ファイル: TestBoolMatrix.cs プロジェクト: unhammer/gimp-sharp
        public void Get()
        {
            const int width = 43;
              const int height = 29;

              var b = new BoolMatrix(width, height);
              b[13, 11] = true;
              Assert.IsTrue(b.Get(new IntCoordinate(11, 13)));
        }
コード例 #3
0
ファイル: TestBoolMatrix.cs プロジェクト: unhammer/gimp-sharp
        public void GenerateOk()
        {
            const int width  = 43;
            const int height = 29;
            var       b      = new BoolMatrix(width, height);
            var       c      = b.Generate(1);

            Assert.IsNotNull(c);
        }
コード例 #4
0
ファイル: TestBoolMatrix.cs プロジェクト: unhammer/gimp-sharp
        public void Constructor()
        {
            const int width = 43;
              const int height = 29;

              var b = new BoolMatrix(width, height);
              Assert.AreEqual(width, b.Width);
              Assert.AreEqual(height, b.Height);
        }
コード例 #5
0
ファイル: TestBoolMatrix.cs プロジェクト: unhammer/gimp-sharp
        public void Get()
        {
            const int width  = 43;
            const int height = 29;

            var b = new BoolMatrix(width, height);

            b[13, 11] = true;
            Assert.IsTrue(b.Get(new IntCoordinate(11, 13)));
        }
コード例 #6
0
ファイル: TestBoolMatrix.cs プロジェクト: unhammer/gimp-sharp
        public void Constructor()
        {
            const int width  = 43;
            const int height = 29;

            var b = new BoolMatrix(width, height);

            Assert.AreEqual(width, b.Width);
            Assert.AreEqual(height, b.Height);
        }
コード例 #7
0
ファイル: TestBoolMatrix.cs プロジェクト: unhammer/gimp-sharp
        public void IsNotInside()
        {
            const int width  = 43;
            const int height = 29;

            var b = new BoolMatrix(width, height);

            Assert.IsFalse(b.IsInside(new IntCoordinate(111, 133)));
            Assert.IsFalse(b.IsInside(new IntCoordinate(width, height)));
            Assert.IsFalse(b.IsInside(new IntCoordinate(-1, -1)));
        }
コード例 #8
0
ファイル: TestBoolMatrix.cs プロジェクト: unhammer/gimp-sharp
        public void IsInside()
        {
            const int width  = 43;
            const int height = 29;

            var b = new BoolMatrix(width, height);

            Assert.IsTrue(b.IsInside(new IntCoordinate(11, 13)));
            Assert.IsTrue(b.IsInside(new IntCoordinate(width - 1, height - 1)));
            Assert.IsTrue(b.IsInside(new IntCoordinate(0, 0)));
        }
コード例 #9
0
ファイル: TestBoolMatrix.cs プロジェクト: unhammer/gimp-sharp
        public void Set()
        {
            const int width  = 43;
            const int height = 29;

            var b = new BoolMatrix(width, height);
            var c = new IntCoordinate(11, 13);

            b.Set(c, true);
            Assert.IsTrue(b.Get(c));
        }
コード例 #10
0
ファイル: TestBoolMatrix.cs プロジェクト: unhammer/gimp-sharp
        public void This()
        {
            const int width  = 43;
            const int height = 29;

            var b = new BoolMatrix(width, height);

            Assert.IsFalse(b[11, 13]);
            b[11, 13] = true;
            Assert.IsTrue(b[11, 13]);
            b[11, 13] = false;
            Assert.IsFalse(b[11, 13]);
        }
コード例 #11
0
ファイル: TestBoolMatrix.cs プロジェクト: unhammer/gimp-sharp
 public void GenerateFail()
 {
     const int width = 43;
       const int height = 29;
       var b = new BoolMatrix(width, height);
       for (int y = 0; y < height; y++)
     {
       for (int x = 0; x < width; x++)
     {
       b[y, x] = true;
     }
     }
       var c = b.Generate(1);
       Assert.IsNull(c);
 }
コード例 #12
0
ファイル: TestBoolMatrix.cs プロジェクト: unhammer/gimp-sharp
        public void GenerateFail()
        {
            const int width  = 43;
            const int height = 29;
            var       b      = new BoolMatrix(width, height);

            for (int y = 0; y < height; y++)
            {
                for (int x = 0; x < width; x++)
                {
                    b[y, x] = true;
                }
            }
            var c = b.Generate(1);

            Assert.IsNull(c);
        }
コード例 #13
0
ファイル: TestBoolMatrix.cs プロジェクト: unhammer/gimp-sharp
        public void IsNotInside()
        {
            const int width = 43;
              const int height = 29;

              var b = new BoolMatrix(width, height);
              Assert.IsFalse(b.IsInside(new IntCoordinate(111, 133)));
              Assert.IsFalse(b.IsInside(new IntCoordinate(width, height)));
              Assert.IsFalse(b.IsInside(new IntCoordinate(-1, -1)));
        }
コード例 #14
0
ファイル: TestBoolMatrix.cs プロジェクト: unhammer/gimp-sharp
        public void IsInside()
        {
            const int width = 43;
              const int height = 29;

              var b = new BoolMatrix(width, height);
              Assert.IsTrue(b.IsInside(new IntCoordinate(11, 13)));
              Assert.IsTrue(b.IsInside(new IntCoordinate(width - 1, height - 1)));
              Assert.IsTrue(b.IsInside(new IntCoordinate(0, 0)));
        }
コード例 #15
0
ファイル: TestBoolMatrix.cs プロジェクト: unhammer/gimp-sharp
        public void This()
        {
            const int width = 43;
              const int height = 29;

              var b = new BoolMatrix(width, height);
              Assert.IsFalse(b[11, 13]);
              b[11, 13] = true;
              Assert.IsTrue(b[11, 13]);
              b[11, 13] = false;
              Assert.IsFalse(b[11, 13]);
        }
コード例 #16
0
ファイル: TestBoolMatrix.cs プロジェクト: unhammer/gimp-sharp
        public void Set()
        {
            const int width = 43;
              const int height = 29;

              var b = new BoolMatrix(width, height);
              var c = new IntCoordinate(11, 13);
              b.Set(c, true);
              Assert.IsTrue(b.Get(c));
        }