Ejemplo n.º 1
0
        public bool Equals(Viewport x, Viewport y)
        {
            if (x == null || y == null)
            {
                return(false);
            }

            if (x.Northeast == null || y.Northeast == null)
            {
                return(false);
            }
            if (x.Southwest == null || y.Southwest == null)
            {
                return(false);
            }

            LatLngComparer c = LatLngComparer.Within(this.Epsilon);

            if (c.Equals(x.Northeast, y.Northeast) == false)
            {
                return(false);
            }

            if (c.Equals(x.Southwest, y.Southwest) == false)
            {
                return(false);
            }

            return(true);
        }
Ejemplo n.º 2
0
        public void Ex_6_precision()
        {
            LatLng expected = new LatLng(30.343434, 40.412121);

            LatLng actual = new LatLng(30.34343400001, 40.41212100001);

            Assert.That(expected, Is.EqualTo(actual).Using(LatLngComparer.Within(0.000001f)));
        }
Ejemplo n.º 3
0
        public void Ex_1_precision()
        {
            LatLng expected = new LatLng(30.3, 40.4);

            LatLng actual = new LatLng(30.31, 40.41);

            Assert.That(expected, Is.EqualTo(actual).Using(LatLngComparer.Within(0.1f)));
        }