public void Equals_SameTypesXDifferent_ReturnFalse()
        {
            var point = new PointCore(9.854, 3819.324);
            var point2 = new PointCore(9.85, 3819.324);

            Assert.IsTrue(!point.Equals(point2));
        }
        public void Equals_NullObject_ReturnFalse()
        {
            var point = new PointCore(9.854, 3819.324);
            object obj = null;

            Assert.IsTrue(!point.Equals(obj));
        }
        public void Equals_SameTypes_ReturnTrue()
        {
            var point = new PointCore(9.854, 3819.324);
            var point2 = new PointCore(9.854, 3819.324);

            Assert.IsTrue(point.Equals(point2));
        }
        public void Equals_DifferentTypes_ReturnFalse()
        {
            var point = new PointCore(9.854, 3819.324);
            var obj = new object();

            Assert.IsTrue(!point.Equals(obj));
        }
        public void EqualityOperator_DifferentObjects_ReturnFalse()
        {
            var point = new PointCore(9.854, 3818.324);
            var point2 = new PointCore(9.852, 3819.324);

            Assert.IsTrue(!(point == point2));
        }
        public void EqualityOperator_SameObject_ReturnTrue()
        {
            var point = new PointCore(9.854, 3819.324);
            var point2 = point;

            Assert.IsTrue(point == point2);
        }
        public void InsertAt_InsertsElementAtGivenPosition_InsertedInProperPlace(double x, double y, int position)
        {
            var expectedPoint = new PointCore(x, y);
            var polygon = new PolygonCore();
            polygon.Insert(0.1, 1.0);
            polygon.Insert(0.2, 1.1);
            polygon.Insert(0.3, 2.0);

            polygon.InsertAt(x, y, position);

            Assert.IsTrue(polygon.Points[position].Equals(expectedPoint));
        }
 public void Constructor_ValuesSetProperly()
 {
     var point = new PointCore(9.854, 3819.324);
     Assert.IsTrue(Math.Abs(point.X - 9.854) < PointCore.EqualityTolerance && Math.Abs(point.Y - 3819.324) < PointCore.EqualityTolerance);
 }