示例#1
0
        public void CopyFrom()
        {
            var catchment1 = new Catchment();
            var catchment2 = new Catchment
            {
                Name     = "Aapje",
                Geometry =
                    new Polygon(
                        new LinearRing(new ICoordinate[]
                {
                    new Coordinate(10d, 10d), new Coordinate(20d, 10d),
                    new Coordinate(15d, 15d), new Coordinate(10d, 10d)
                })),
                Description = "Komt uit de mouw",
                Network     = new HydroNetwork()
            };

            catchment2.Attributes.Add("gras", 15);

            catchment1.CopyFrom(catchment2);

            Assert.AreNotEqual(catchment1.Geometry, catchment2.Geometry);
            Assert.AreNotEqual(catchment1.Name, catchment2.Name);
            Assert.AreEqual(catchment1.Attributes, catchment2.Attributes);
            Assert.AreEqual(catchment1.Description, catchment2.Description);
            Assert.AreSame(catchment1.Network, catchment2.Network);
            Assert.AreNotSame(catchment1.Attributes, catchment2.Attributes);
        }