Пример #1
0
        public void TestCalcRowCol1()
        {
            Triangle t = new Triangle()
            {
                V1 = new Triangle.TriangleVertex()
                {
                    Row = 0,
                    Col = 0
                },
                V2 = new Triangle.TriangleVertex()
                {
                    Row = 0,
                    Col = 10
                },
                V3 = new Triangle.TriangleVertex()
                {
                    Row = 10,
                    Col = 10
                }
            };

            TriangleCoords.TriangleLocation r =
                TriangleCoords.CalcRowAndCol(t, 10);

            Assert.AreEqual('A', r.Row);
            Assert.AreEqual(2, r.Col);
        }
Пример #2
0
        public void TestCalcRowCol3()
        {
            Triangle t = new Triangle()
            {
                V1 = new Triangle.TriangleVertex()
                {
                    Row = 50,
                    Col = 50,
                },
                V2 = new Triangle.TriangleVertex()
                {
                    Row = 60,
                    Col = 60
                },
                V3 = new Triangle.TriangleVertex()
                {
                    Row = 50,
                    Col = 60
                }
            };

            TriangleCoords.TriangleLocation r =
                TriangleCoords.CalcRowAndCol(t, 10);

            Assert.AreEqual('F', r.Row);
            Assert.AreEqual(12, r.Col);
        }
Пример #3
0
        public void TestCalcRowCol2()
        {
            Triangle t = new Triangle()
            {
                V1 = new Triangle.TriangleVertex()
                {
                    Row = 40,
                    Col = 30,
                },
                V2 = new Triangle.TriangleVertex()
                {
                    Row = 40,
                    Col = 40
                },
                V3 = new Triangle.TriangleVertex()
                {
                    Row = 30,
                    Col = 30
                }
            };

            TriangleCoords.TriangleLocation r =
                TriangleCoords.CalcRowAndCol(t, 10);

            Assert.AreEqual('D', r.Row);
            Assert.AreEqual(7, r.Col);
        }
Пример #4
0
 public void TestCalcRowColBadInputs()
 {
     var r = TriangleCoords.CalcRowAndCol(null, 10);
 }