public void GetPropertyId_PropertyNotFound_ExceptionThrown()
 {
     zillowClient.Setup<XDocument>(z => z.GetSearchResults(fakeAddress, fakeCityStateZip)).Returns(fakeNotFoundZillowSearchResult);
     AssetQuoter assetQuoter = new AssetQuoter(zillowClient.Object, yahooFinanceClient.Object);
     assetQuoter.GetPropertyId(fakeAddress, fakeCity, fakeState, fakeZip);
 }
        public ActionResult CreateRealEstate(RealEstateAssetData model)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    AssetQuoter quoter = new AssetQuoter(new ZillowClient(), new YahooFinanceClient()); //TODO setup ninject to inject these automatically
                    model.Asset.Symbol = quoter.GetPropertyId(model.Address, model.City, model.State, model.Zip);
                }
                catch (ZillowPropertyNotFoundException)
                {
                    ModelState.AddModelError(string.Empty, "Property not found on Zillow");
                }
            }

            if (ModelState.IsValid)
            {
                repository.AddRealEstateAssetData(model);
                return RedirectToAction("RealEstate");
            }

            return View(model);
        }
 public void GetPropertyId_PropertyFound_ExpectedResult()
 {
     zillowClient.Setup<XDocument>(z => z.GetSearchResults(fakeAddress, fakeCityStateZip)).Returns(fakeFoundZillowSearchResult);
     AssetQuoter assetQuoter = new AssetQuoter(zillowClient.Object, yahooFinanceClient.Object);
     string propertyId = assetQuoter.GetPropertyId(fakeAddress, fakeCity, fakeState, fakeZip);
     Assert.AreEqual<string>(fakeZpId, propertyId);
 }