Esempio n. 1
0
        public void TestMethod(float sx, float sz, float sdx, float sdz, int sm, float ex, float ez, float edx, float edz, int em, int r, bool cw, float rx, float rz)
        {
            var result = RoundRoadTools.FoundRound(new NodePoint(sx, sz, sdx, sdz, mode: (Direction)sm), new NodePoint(ex, ez, edx, edz, mode: (Direction)em), r * RoundRoadTools.U, cw);

            Assert.AreEqual(rx, result.RoundCenterPos.x, 0.001);
            Assert.AreEqual(rz, result.RoundCenterPos.y, 0.001);
        }
Esempio n. 2
0
        public void CalculateShiftsIndexTestMethod(int shifts, int starts, int rounds, int ends, int[] expected)
        {
            var result = RoundRoadTools.CalculateShiftsIndex(shifts, starts, rounds, ends);

            Assert.AreEqual(expected.Length, result.Length, "Различная длина");
            for (int i = 0; i < expected.Length; i += 1)
            {
                Assert.AreEqual(expected[i], result[i], $"Элемент {i}");
            }
        }
Esempio n. 3
0
 public void ParallelLinesTestMethod(float sx, float sz, float sdx, float sdz, int sm, float ex, float ez, float edx, float edz, int em, int r, bool cw)
 {
     Assert.ThrowsException <RoadParallelLinesException>(() => RoundRoadTools.FoundRound(new NodePoint(sx, sz, sdx, sdz, mode: (Direction)sm), new NodePoint(ex, ez, edx, edz, mode: (Direction)em), r, cw));
 }