Esempio n. 1
0
        public void Index()
        {
            // Arrange
            HomeController controller = new HomeController();

            // Act
            var        query  = new ZoneQuery();
            ViewResult result = controller.Index(query) as ViewResult;

            // Assert
            Assert.AreEqual("(Giraffes by name, monkeys by nature).", result.ViewBag.Message);
        }
Esempio n. 2
0
        public ActionResult Index(ZoneQuery query)
        {
            if (ModelState.IsValid)
            {
                Console.WriteLine(query.Address);
                if (!string.IsNullOrEmpty(query.Address) || !string.IsNullOrEmpty(query.LatLong))
                {
                    return(RedirectToAction("Search", query));
                }
            }
            ViewBag.Message = "(Giraffes by name, monkeys by nature).";

            return(View());
        }
Esempio n. 3
0
        //
        // POST: /Home/Search

        //[HttpPost]
        public ActionResult Search(ZoneQuery query)
        {
            if (ModelState.IsValid)
            {
                var service = new GironkeyService();
                // ViewBag.Result = service.GetDataForAddress(query.Address);
                // query.LatLong = "115.90114501745099,-31.915819563332345";
                // query.LatLong = "115.802821,-31.940334";

                if (!string.IsNullOrEmpty(query.LatLong))
                {
                    ViewBag.Result = service.CallLandgate(query.LatLong); // .CallLandgateGetJson();
                }

                Console.WriteLine(query.Address);
            }

            return(View(query));
        }
Esempio n. 4
0
 public async Task <List <Zone> > GetZones(ZoneQuery query)
 {
     return(await this.client.Get <List <Zone> >(zonesController, query));
 }
Esempio n. 5
0
 public Task <Zone> FindZoneById(int zoneId, ZoneQuery query)
 {
     throw new NotImplementedException();
 }
Esempio n. 6
0
 public async Task <ActionResult <List <Zone> > > GetZones(
     [FromServices] IZoneService zoneService,
     [FromQuery] ZoneQuery query)
 {
     return(await zoneService.GetZones(query));
 }
Esempio n. 7
0
 public ZoneQuery Zone([Inject] ZoneQuery entityQuery)
 {
     return(entityQuery);
 }