public GeocodingArg(GeocodingViewModel addressViewModel) { if (addressViewModel != null) { Street = addressViewModel.Address; City = addressViewModel.City; State = addressViewModel.State; ZIP = addressViewModel.ZIP; } }
public void GetLocation_should_return_all_not_empty_preperties() { //arrange var argument = new GeocodingViewModel { City = "city", State = "st" }; var target = new GeocodingArg(argument); //act var actual = target.GetLocation(); //assert Assert.AreEqual(HttpUtility.UrlEncode(string.Join(",", new[] { argument.City, argument.State })), actual); }
public void ctor_should_intialize_properties() { //arrange var expected = new GeocodingViewModel { City = "city", State = "state", Address = "street", ZIP = "zip" }; //act var target = new GeocodingArg(expected); //assert Assert.AreEqual(expected.City, target.City); Assert.AreEqual(expected.State, target.State); Assert.AreEqual(expected.Address, target.Street); Assert.AreEqual(expected.ZIP, target.ZIP); }
public void ResolveRequestAsync(GeocodingViewModel addressViewModel, int? editUserId) { if (ModelState.IsValid) { AsyncManager.OutstandingOperations.Increment(); _geocodingDataService.ResolveData((GeocodingArg)addressViewModel, (result, containResult) => { AsyncManager.Parameters["result"] = result; AsyncManager.Parameters["containResult"] = containResult; AsyncManager.Parameters["editUserId"] = editUserId; AsyncManager.OutstandingOperations.Decrement(); }); } }