示例#1
0
文件: GeocodingArg.cs 项目: evkap/DVS
		public GeocodingArg(GeocodingViewModel addressViewModel)
		{
			if (addressViewModel != null)
			{
				Street = addressViewModel.Address;
				City = addressViewModel.City;
				State = addressViewModel.State;
				ZIP = addressViewModel.ZIP;
			}
		}
示例#2
0
		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);
		}
示例#3
0
		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);
		}
示例#4
0
		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();
																																										});
			}
		}