public void TruliaBot_BadBotTypeUrl_ShouldThrowException()
        {
            string url  = BAD_BOT_TYPE_URL;
            string html = File.ReadAllText("BotHtml\\TruliaProperty.html");

            TruliaBot bot = new TruliaBot(url, _mapper, html);

            bot.Bot();
        }
        public void TruliaBot_BotRental_ShouldReturnProperty()
        {
            string url  = RENTAL_URL;
            string html = File.ReadAllText("BotHtml\\TruliaRental.html");

            //Mock mapper will cause an exception to be thrown in BotRentalJson and cause BotRental to fire.
            TruliaBot bot      = new TruliaBot(url, _mockMapper.Object, html);
            var       property = bot.Bot();

            property.Should().NotBeNull();
            property.NumberOfBathrooms.Should().Be(1);
            property.NumberOfBedrooms.Should().Be(1);
            property.City.Should().Be("Westlake".ToUpper());
            property.State.Should().Be("OH");
            property.PostalCode.Should().Be("44145");
            property.Street1.Should().Be("1575 Hunters Chase Dr".ToUpper());
            property.Description.Should().NotBeNullOrWhiteSpace();
            property.Amount.Should().Be(909);
            property.SourceUrl.Should().Be(url);
        }
        public void TruliaBot_BotProperty_ShouldReturnProperty()
        {
            string url  = PROPERTY_URL;
            string html = File.ReadAllText("BotHtml\\TruliaProperty.html");

            TruliaBot bot      = new TruliaBot(url, _mockMapper.Object, html);
            var       property = bot.Bot();

            property.Should().NotBeNull();
            property.NumberOfBathrooms.Should().Be(1);
            property.NumberOfBedrooms.Should().Be(3);
            property.City.Should().Be("Cleveland".ToUpper());
            property.State.Should().Be("OH");
            property.PostalCode.Should().Be("44130");
            property.Street1.Should().Be("6411 Springwood Rd".ToUpper());
            property.Description.Should().NotBeNullOrWhiteSpace();
            property.Amount.Should().Be(126900);
            property.SquareFootage.Should().Be(1386);
            property.SourceUrl.Should().Be(url);
        }
        public void TruliaBot_BotRentalJson_ShouldReturnProperty()
        {
            string url = RENTAL_URL;

            string    html     = File.ReadAllText("BotHtml\\TruliaRental.html");
            TruliaBot bot      = new TruliaBot(url, _mapper, html);
            var       property = bot.Bot();

            property.Should().NotBeNull();
            property.Latitude.Should().Be(41.466267m);
            property.Longitude.Should().Be(-81.94102m);
            property.NumberOfBathrooms.Should().Be(1);
            property.NumberOfBedrooms.Should().Be(2);
            property.City.Should().Be("Westlake");
            property.State.Should().Be("OH");
            property.PostalCode.Should().Be("44145");
            property.Street1.Should().Be("1575 Hunters Chase Dr");
            property.Description.Should().NotBeNullOrWhiteSpace();
            property.Amount.Should().Be(909);
            property.SquareFootage.Should().Be(676);
            property.SourceUrl.Should().Be(url);
        }
        public void TruliaBot_BotBuilderCommunity_ShouldReturnProperty()
        {
            string url  = BUILDER_COMMUNITY_URL;
            string html = File.ReadAllText("BotHtml\\TruliaBuilderCommunity.html");

            TruliaBot bot      = new TruliaBot(url, _mapper, html);
            var       property = bot.Bot();

            property.Should().NotBeNull();
            property.Latitude.Should().Be(41);
            property.Longitude.Should().Be(-81);
            property.NumberOfBathrooms.Should().Be(2);
            property.NumberOfBedrooms.Should().Be(2);
            property.City.Should().Be("Cleveland");
            property.State.Should().Be("OH");
            property.PostalCode.Should().Be("44102");
            property.Street1.Should().Be("7524 Father Frascati Dr");
            property.Description.Should().NotBeNullOrWhiteSpace();
            property.Amount.Should().Be(499900);
            property.SquareFootage.Should().Be(1817);
            property.SourceUrl.Should().Be(url);
        }