示例#1
0
        private Property GetDummyPropertyWithValidRentalData()
        {
            var property = new Property()
            {
                PropertyId   = 0,
                AddressLine1 = "34 St James Rd",
                City         = "London",
                PostCode     = "LA11 62F",
                Country      = "UK",
                PropertyType = "House",
                BuildDate    = DateTime.MinValue,
                NoOfBedrooms = 3,
                Garden       = true,
                Parking      = true,
                Epcrating    = "B",
                PhotoRef     = "25d3d4de-3e8d-4d87-968c-1e8d5a6b303e"
            };

            var propertiesForRent = new PropertiesForRent()
            {
                RentalId              = 1,
                PropertyId            = 1,
                PricePcm              = 1200,
                PetsAllowed           = true,
                PropertyAvailableFrom = DateTime.MinValue,
            };

            property.PropertiesForRent.Add(propertiesForRent);

            return(property);
        }
        public IActionResult SpecificProperty(int rentalId)
        {
            PropertiesForRent propertyForRent = _db.PropertiesForRent.Where(p => p.RentalId == rentalId).FirstOrDefault();
            Property          property        = _db.Property.Where(p => p.PropertiesForRent.First().RentalId == rentalId).FirstOrDefault();

            RentalPropertyViewModel propertyViewModel = RentalPropertyMapper.MapPropertyToRentalPropertyVM(property);

            return(View(propertyViewModel));
        }
示例#3
0
        public void ThenICanSearchThisRentalPropertySuccessfullyUnderPropertiesForRentPage()
        {
            // Creates a toggle for the given test, adds all log events under it
            test = extent.CreateTest("List A Rental -- Search the rental property after listing a rental property");

            // Got the search data from excel
            ExcelLib.PopulateInCollection(Base.ExcelPath, "List Rental Property");
            String searchPropertyName = ExcelLib.ReadData(2, "Title");

            PropertiesForRent obj = new PropertiesForRent();

            if (obj.SearchRentalPropertySuccessfully(searchPropertyName))
            {
                Base.test.Log(AventStack.ExtentReports.Status.Pass, "Test Passed, successfully search new list rental property under properties for rent page");
            }
            else
            {
                Base.test.Log(AventStack.ExtentReports.Status.Pass, "Test failed, fail to search new list rental property under properties for rent page");
            }
        }