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); }
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); }