private void ShowCoordinatesToolStripButtonClick(object sender, EventArgs e) { showCoordinatesToolStripButton.Checked = !showCoordinatesToolStripButton.Checked; if (showCoordinatesToolStripButton.Checked) { mouseCoordinatesMapExtension.Activate(); } else { mouseCoordinatesMapExtension.Deactivate(); } }
public void Activate_Always_AddsControlToMap() { // Setup using (var map = new Map()) using (var extension = new RdNewMouseCoordinatesMapExtension(map)) { // Call extension.Activate(); // Assert Assert.AreEqual(1, map.Controls.Count); } }
public void Deactivate_Always_RemovesControlFromMap() { // Setup using (var map = new Map()) using (var extension = new RdNewMouseCoordinatesMapExtension(map)) { extension.Activate(); // Precondition Assert.AreEqual(1, map.Controls.Count); // Call extension.Deactivate(); // Assert Assert.AreEqual(0, map.Controls.Count); } }