Ejemplo n.º 1
0
        public void TestDefaultConstructor()
        {
            TSegment segment = new TSegment();

            Assert.AreEqual(0, segment.First.X);
            Assert.AreEqual(0, segment.First.Y);
            Assert.AreEqual(0, segment.Last.X);
            Assert.AreEqual(0, segment.Last.Y);
        }
Ejemplo n.º 2
0
        public void TestConstructorWithParameters()
        {
            TSegment segment = new TSegment(new TPoint(1, 2), new TPoint(3, 4));

            Assert.AreEqual(1, segment.First.X);
            Assert.AreEqual(2, segment.First.Y);
            Assert.AreEqual(3, segment.Last.X);
            Assert.AreEqual(4, segment.Last.Y);
        }
Ejemplo n.º 3
0
        public void TestManhattanMethod()
        {
            TSegment segment = new TSegment(new TPoint(1, 1), new TPoint(4, 5));

            Assert.AreEqual(7, segment.Manhattan());
        }
Ejemplo n.º 4
0
        public void TestEuklidesMethod()
        {
            TSegment segment = new TSegment(new TPoint(1, 1), new TPoint(4, 5));

            Assert.AreEqual(5, segment.Euklides());
        }