Пример #1
0
        public async Task Build_Flood_Model_From_Data()
        {
            //Arrange
            FloodDataResults flood_data = new FloodDataResults();

            //Act
            FloodDataResultModel data = await flood_data.Get_Flood_Data_Model_By_Coordiantes(27.950575, -82.457176);

            //Assert
            Assert.IsNotNull(data);

            Assert.IsTrue(!string.IsNullOrWhiteSpace(data.FloodZone));

            Assert.IsNotNull(data.SpecialFloodHazardArea);
        }
Пример #2
0
        public async Task <ActionResult> GetFloodDataByCoordinates(double latitude, double longitude)
        {
            try
            {
                FloodDataResults flood_data_api = new FloodDataResults();

                var flood_data = await flood_data_api.Get_Flood_Data_Model_By_Coordiantes(latitude, longitude);

                return(Json(new { data = flood_data }));
            }
            catch (Exception ex)
            {
                return(Json(new { data = "Unable to return flood data" }));
            }
        }