Exemple #1
0
        public static LandListing CreateAFakeLandListing(string id = "Land-Current-ABCD1234",
                                                         PropertyType propertyType = PropertyType.House)
        {
            var listing = new LandListing
            {
                Id = id
            };

            FakeCommonListingHelpers.SetCommonListingData(listing);
            listing.Address.StreetNumber = "LOT 12/39";
            listing.Features.Bedrooms    = 0;
            listing.Features.Bathrooms   = 0;
            listing.Features.Ensuites    = 0;
            listing.Features.CarParking  = new CarParking();

            FakeCommonListingHelpers.SetSalePrice(listing);
            SetLandEstate(listing);
            listing.AuctionOn    = new DateTime(2009, 1, 24, 12, 30, 00, DateTimeKind.Utc);
            listing.CategoryType = CategoryType.Residential;
            listing.CouncilRates = "$2000 per month";

            listing.Features.Tags.Remove("houseAndLandPackage");
            listing.Features.Tags.Remove("isANewConstruction");
            listing.Features.Tags.Remove("hotWaterService-gas");
            listing.Features.Tags.Remove("heating-other");
            listing.Features.Tags.Remove("balcony");
            listing.Features.Tags.Remove("shed");
            listing.Features.Tags.Remove("courtyard");

            return(listing);
        }
        private static Listing CreateListing(CategoryType categoryType)
        {
            Listing listing;

            switch (categoryType)
            {
            case CategoryType.Sale:
                listing = new ResidentialListing();
                break;

            case CategoryType.Rent:
                listing = new RentalListing();
                break;

            case CategoryType.Land:
                listing = new LandListing();
                break;

            case CategoryType.Rural:
                listing = new RuralListing();
                break;

            default:
                // Not sure if we should do some logging here?
                listing = null;
                break;
            }

            return(listing);
        }
Exemple #3
0
        public static LandListing LandListing(bool isClearAllIsModified = true)
        {
            var listing = new LandListing
            {
                CategoryType = LandListingCategoryType.Residential,
                AuctionOn    = new DateTime(2015, 5, 23),
                CouncilRates = "some council rates",
                Estate       = new LandEstate
                {
                    Name  = "some land estate",
                    Stage = "1st stage"
                },
                Pricing = new SalePricing
                {
                    IsUnderOffer  = true,
                    SalePrice     = 12345.66m,
                    SalePriceText = "house for sale",
                    SoldOn        = new DateTime(2015, 6, 1),
                    SoldPrice     = 45432.99m,
                    SoldPriceText = "just sold woot!"
                }
            };

            if (isClearAllIsModified)
            {
                listing.ClearAllIsModified();
            }

            return(listing);
        }
Exemple #4
0
 private static void SetLandEstate(LandListing listing)
 {
     listing.Estate = new LandEstate
     {
         Name  = "Panorama",
         Stage = "5"
     };
 }
        protected static LandListing FakeLandListing(StatusType statusType)
        {
            var listing = new LandListing();

            SetupListing(listing, statusType);

            return(listing);
        }
Exemple #6
0
        public static ValidationResult Validate(LandListing landListing,
                                                string ruleSet = ResidentialListingValidator.NormalRuleSet)
        {
            var validator = new LandListingValidator();

            return(string.IsNullOrWhiteSpace(ruleSet)
                ? validator.Validate(landListing)
                : validator.Validate(landListing, ruleSet: ruleSet));
        }
 private static void AssertLandListing(ParsedResult result,
                                       LandListing expectedListing)
 {
     result.ShouldNotBeNull();
     result.Listings.Count.ShouldBe(1);
     result.Errors.Count.ShouldBe(0);
     result.UnhandledData.Count.ShouldBe(0);
     LandListingAssertHelpers.AssertLandListing(result.Listings.First().Listing as LandListing,
                                                expectedListing);
 }
Exemple #8
0
        public static void AssertLandListing(LandListing source,
                                             LandListing destination)
        {
            ListingAssertHelpers.AssertCommonData(source, destination);
            SalePricingAssertHelpers.AssertSalePrice(source.Pricing, destination.Pricing);
            AssertLandEstate(source.Estate, destination.Estate);

            source.AuctionOn.ShouldBe(destination.AuctionOn);
            source.CategoryType.ShouldBe(destination.CategoryType);
            source.CouncilRates.ShouldBe(destination.CouncilRates);
        }
        private static void ExtractLandData(LandListing landListing, XElement xElement, CultureInfo cultureInfo)
        {
            landListing.ShouldNotBe(null);
            xElement.ShouldNotBe(null);

            landListing.CategoryType = ExtractLandCategoryType(xElement);
            landListing.Pricing      = ExtractSalePricing(xElement, cultureInfo);
            landListing.AuctionOn    = ExtractAuction(xElement);
            landListing.Estate       = ExtractLandEstate(xElement);
            landListing.AuctionOn    = ExtractAuction(xElement);
        }
Exemple #10
0
            private static void AssertLandSoldListing(LandListing listing,
                                                      bool isSoldPriceVisibile = true)
            {
                listing.AgencyId.ShouldBe("XNWXNW");
                listing.Id.ShouldBe("Land-Sold-ABCD1234");
                listing.StatusType.ShouldBe(StatusType.Sold);

                listing.Pricing.SoldPrice.ShouldBe(85000m);
                listing.Pricing.SoldPriceText.ShouldBe(isSoldPriceVisibile
                    ? null
                    : "Sold Price Witheld");
                listing.Pricing.SoldOn.ShouldBe(new DateTime(2009, 01, 10, 12, 30, 00));
            }
Exemple #11
0
            private static void AssertLandCurrentListing(LandListing listing,
                                                         LandCategoryType landCategoryType = LandCategoryType.Residential)
            {
                listing.AgencyId.ShouldBe("XNWXNW");
                listing.Id.ShouldBe("Land-Current-ABCD1234");
                listing.StatusType.ShouldBe(StatusType.Current);
                listing.CategoryType.ShouldBe(landCategoryType);

                listing.Agents.Count.ShouldBe(1);
                listing.Agents[0].Name.ShouldBe("Mr. John Doe");
                listing.Agents[0].Communications.Count.ShouldBe(3);

                listing.Address.StreetNumber.ShouldBe("LOT 12/39");
                listing.Address.Street.ShouldBe("Main Road");
                listing.Address.Suburb.ShouldBe("RICHMOND");
                listing.Address.IsStreetDisplayed.ShouldBe(true);

                listing.Pricing.IsUnderOffer.ShouldBe(false);
                listing.Pricing.SalePrice.ShouldBe(80000);
                listing.Pricing.SalePriceText.ShouldBe("To suit buyers 60K+");

                listing.Estate.Name.ShouldBe("Panorama");
                listing.Estate.Stage.ShouldBe("5");

                listing.LandDetails.Area.Type.ShouldBe("square");
                listing.LandDetails.Area.Value.ShouldBe(60m);
                listing.LandDetails.Frontage.Type.ShouldBe("meter");
                listing.LandDetails.Frontage.Value.ShouldBe(20m);
                listing.LandDetails.Depth.Type.ShouldBe("meter");
                listing.LandDetails.Depth.Value.ShouldBe(30m);
                listing.LandDetails.Depth.Side.ShouldBe("rear");
                listing.LandDetails.CrossOver.ShouldBe("left");

                listing.Images.Count.ShouldBe(2);
                listing.Images[0].Order.ShouldBe(1);
                listing.Images[0].Url.ShouldBe("http://www.realestate.com.au/tmp/imageM.jpg");

                listing.FloorPlans.Count.ShouldBe(2);
                listing.FloorPlans[0].Order.ShouldBe(1);
                listing.FloorPlans[0].Url.ShouldBe("http://www.realestate.com.au/tmp/floorplan1.gif");

                listing.AuctionOn.ShouldBe(new DateTime(2009, 1, 24, 12, 30, 00));
            }