예제 #1
0
 public void SelectionTest()
 {
     PointEditor pointMutator = new PointEditor(null, null, sampleFeature, GetStyle(Pens.Red));
     ITrackerFeature tracker = pointMutator.GetTrackerByIndex(0);
     // The tracker has focus by default; is this ok
     Assert.AreEqual(true, tracker.Selected);
     pointMutator.Select(tracker, false);
     Assert.AreEqual(false, tracker.Selected);
 }
예제 #2
0
        public void PointMutatorCreationWithoutMapControlTest()
        {
            PointEditor pointMutator = new PointEditor(null, null, sampleFeature, GetStyle(Pens.Red));
            Assert.AreEqual(null, pointMutator.TargetFeature);
            Assert.AreNotEqual(null, pointMutator.SourceFeature);
            // The tracker has focus by default; is this ok
            IList<ITrackerFeature> trackers = pointMutator.GetFocusedTrackers();
            Assert.AreEqual(1, trackers.Count);

            ITrackerFeature tracker = pointMutator.GetTrackerByIndex(0);
            Assert.AreNotEqual(null, tracker);

            pointMutator.Start();
            Assert.AreNotEqual(null, pointMutator.TargetFeature);
            Assert.AreNotEqual(pointMutator.SourceFeature, pointMutator.TargetFeature);
        }
예제 #3
0
        public void PointMutatorCreationWithMapControlTest()
        {
            IMapControl mapControl = new MapControl {Map = {Size = new Size(1000, 1000)}};
            ICoordinateConverter coordinateConverter = new CoordinateConverter(mapControl);
            PointEditor pointMutator = new PointEditor(coordinateConverter, null,
                                                       sampleFeature, GetStyle(Pens.Red));
            Assert.AreEqual(null, pointMutator.TargetFeature);
            Assert.AreNotEqual(null, pointMutator.SourceFeature);

            ITrackerFeature tracker = pointMutator.GetTrackerAtCoordinate(new Coordinate(0, 0));
            Assert.AreNotEqual(null, tracker);

            pointMutator.Start();
            pointMutator.MoveTracker(tracker, 5.0, 5.0, null);
            pointMutator.Stop();

            Assert.AreEqual(5.0, tracker.Geometry.Coordinates[0].X);
            Assert.AreEqual(5.0, tracker.Geometry.Coordinates[0].Y);
            Assert.AreEqual(5.0, sampleFeature.Geometry.Coordinates[0].X);
            Assert.AreEqual(5.0, sampleFeature.Geometry.Coordinates[0].Y);
        }