Пример #1
0
		public void GetDataPoints() {
			var api = MockRepository.GenerateMock<IZillowAPI>();
			api.Stub(a => a.GetDeepSearchResults(null)).IgnoreArguments().Return(XDocument.Load("DeepSearchResult.xml"));
			api.Stub(a => a.GetMonthlyPaymentResults(null)).IgnoreArguments().Return(XDocument.Load("MonthlyResult.xml"));
			
			var data = new DataRetriever(api).GetData(new Address());
			Assert.AreEqual("2064", data.SquareFootage);
			Assert.AreEqual("1444", data.MonthlyRent);
			Assert.AreEqual("57", data.MonthlyInsurance);
			Assert.AreEqual("292", data.MonthlyTaxes);
			Assert.AreEqual("152379", data.Zestimate);
			Assert.AreEqual("9872758", data.Address.ID);
		}
Пример #2
0
		static void Main(string[] args) {
			var dataRetriever = new DataRetriever(new ZillowAPI());
			var proFormaBuilder = new ProFormaBuilder();

			var keepGoing = true;
			while (keepGoing) {
				Console.WriteLine("Enter Street (i.e.  527 Stanbridge Street):");
				var streetAddress = Uri.EscapeUriString(Console.ReadLine());

				Console.WriteLine("Enter Zip:");
				var zip = Uri.EscapeUriString(Console.ReadLine());

				Console.WriteLine(proFormaBuilder.Output(dataRetriever.GetData(new Address { Zip = zip, Street = streetAddress })));

				Console.WriteLine("Search Another (Y/N):");
				var answer = Console.ReadLine();
				keepGoing = answer.ToLowerInvariant().StartsWith("y");
			}
		}
Пример #3
0
		public ZillowFormPresenter(IZillowAPI api, IRepository repository) {
			retriever = new DataRetriever(api);
			this.repository = repository;
		}