private void SetupMapView()
        {
            var map              = Element;
            var mapView          = Control;
            var petDetailCommand = map.ShowDetailCommand;

            _centerOnUserLocation = new UIButton();
            _centerOnUserLocation.SetImage(UIImage.FromBundle("center.png"), UIControlState.Normal);
            _centerOnUserLocation.AutoresizingMask = (UIViewAutoresizing.FlexibleTopMargin & UIViewAutoresizing.FlexibleLeftMargin);

            PositionControls(UIApplication.SharedApplication.StatusBarOrientation);
            mapView.Add(_centerOnUserLocation);

            mapView.Delegate = null;
            mapView.Delegate = new PetsMapDelegate(petDetailCommand);              // No dragging, but with Callout. Provide command to call when the callout button is clicked
            _petManager      = new MonkeyManager(mapView);
            mapView.SetRegion(MKCoordinateRegion.FromDistance(new CLLocationCoordinate2D(Location.DefaultPosition.Latitude, Location.DefaultPosition.Longitude), 5000, 5000), true);

            _centerOnUserLocation.TouchUpInside += async(sender, e) => await SetMapCenterToUserLocation();
        }
Example #2
0
        public void TestRun_PassingMultipleMonkeys_ShouldReturnTwentyEightIterations()
        {
            var monkeyManager = new MonkeyManager(output, 4, 9);

            Assert.AreEqual(28, monkeyManager.Run());
        }
Example #3
0
        public void TestRun_PassingOneMonkeyEachSide_ShouldReturnEightIterations()
        {
            var monkeyManager = new MonkeyManager(output, 1, 1);

            Assert.AreEqual(8, monkeyManager.Run());
        }
Example #4
0
        public void TestRun_PassingOneMonkeyRightSide_ShouldReturnFourIterations()
        {
            var monkeyManager = new MonkeyManager(output, 0, 1);

            Assert.AreEqual(4, monkeyManager.Run());
        }
Example #5
0
        public void TestRun_PassingNoMonkeys_ShouldReturnCeroIterations()
        {
            var monkeyManager = new MonkeyManager(output, 0, 0);

            Assert.AreEqual(0, monkeyManager.Run());
        }
Example #6
0
 public void setMonkeyManager(MonkeyManager val)
 {
     monkeyManager = val;
 }