Ejemplo n.º 1
0
        public void TestFeatureAttributes()
        {
            var g = _factory.CreatePoint(new Coordinate(10, 10));
            var t = new PoIFeature {
                Oid = 887, Kind = PoIKind.Restaurant, Name = "Test", Geometry = g
            };

            var attDef = t.AttributesDefinition;

            Assert.AreEqual(4, attDef.Count);

            IFeatureAttributes att = null;

            Assert.DoesNotThrow(() => att = ((IFeature)t).Attributes);

            Assert.AreEqual(t.Oid, (long)att["Oid"]);
            Assert.AreEqual(t.Kind, (PoIKind)att["Kind"]);
            Assert.AreEqual(t.Name, (string)att["Name"]);
            Assert.AreEqual(t.Geometry, (IGeometry)att["Geometry"]);

            g = _factory.CreatePoint(new Coordinate(20, 20));
            att["Geometry"] = g;

            Assert.AreEqual(g, t.Geometry);
        }
Ejemplo n.º 2
0
        private void Test(IFeatureAttributes p, string property, object value, bool expectEvent)
        {
            _propertyName = null;
            p[property]   = value;

            if (expectEvent)
            {
                Assert.AreEqual(property, _propertyName);
            }
            else
            {
                Assert.IsNull(_propertyName);
            }
        }
Ejemplo n.º 3
0
        private void Test(IFeatureAttributes p, string property, object value, bool expectEvent)
        {
            _propertyName = null;
            p[property] = value;

            if (expectEvent)
            {
                Assert.AreEqual(property, _propertyName);
            }
            else
            {
                Assert.IsNull(_propertyName);
            }
        }