예제 #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();
																																										});
			}
		}