Пример #1
0
        public void AdvancedSearchAds_SearchThroughCarAds_CallSearchRepoOnCarAds()
        {
            // Given
            Category cat = new Category { Id = 1, LabelUrlPart = "cat-url-label", Label = "Label", Type = AdTypeEnum.CarAd };

            AdvancedAdSearchModel model = new AdvancedAdSearchModel();
            model.CategorySelectedId = 1;
            model.SearchString = "toto";
            model.CitySelectedId = 12;
            model.AgeBracketSelectedId = 1;
            model.KmBracketSelectedId = 1;
            model.BrandSelectedId = 19;
            model.FuelSelectedId = 89;
            model.IsAutomatic = true;

            IList<SearchAdCache> searchResult = new List<SearchAdCache>();
            searchResult.Add(new SearchAdCache
            {
                Title = "car",
                City = new City() { Label = "the city" },
                Category = cat
            });

            var repoMock = new Moq.Mock<IRepository>();
            repoMock.Setup(r => r.Get<Category>(cat.Id)).Returns(cat);

            var helperMock = new Moq.Mock<IHelperService>();
            helperMock.Setup(r => r.GetCurrentDateTime()).Returns(new DateTime(2013, 01, 01));

            IDictionary<int, BracketItemReference> ageRef = new Dictionary<int, BracketItemReference>();
            ageRef.Add(1, new BracketItemReference { LowValue = 0, HighValue = 3 });
            IDictionary<int, BracketItemReference> kmRef = new Dictionary<int, BracketItemReference>();
            kmRef.Add(1, new BracketItemReference { LowValue = 50, HighValue = 100 });

            var refMock = new Moq.Mock<IReferenceServices>();
            refMock.Setup(s => s.GetAllAgeBrackets()).Returns(ageRef);
            refMock.Setup(s => s.GetAllKmBrackets()).Returns(kmRef);

            var searchRepoMock = new Moq.Mock<ISearchRepository>();
            searchRepoMock.Setup(r => r.AdvancedSearchAds<CarAd>(
                It.Is<AdSearchParameters>(p =>
                    p.AndSearchStrings[0].Equals("toto")
                    && p.CityId == 12
                    && p.CategoryIds[0] == 1
                    && p.MinKm == 50
                    && p.MaxKm == 100
                    && p.MinYear == 2010
                    && p.MaxYear == 2013
                    && p.BrandId == 19
                    && p.FueldId == 89
                    && p.IsAuto.Value))).Returns(searchResult);

            SearchServices service = new SearchServices(repoMock.Object, null, searchRepoMock.Object, helperMock.Object, refMock.Object, null);

            // When
            AdSearchResultModel result = service.AdvancedSearchAds(model);

            // Then
            Assert.AreEqual(1, result.SearchResultTotalCount);
        }
Пример #2
0
        public AdvancedAdSearchModel(AdvancedAdSearchModel searchModel)
            : base(searchModel)
        {
            this.MinPrice = searchModel.MinPrice;
            this.MaxPrice = searchModel.MaxPrice;

            this.AgeBracketSelectedId = searchModel.AgeBracketSelectedId;
            this.KmBracketSelectedId = searchModel.KmBracketSelectedId;

            this.BrandSelectedId = searchModel.BrandSelectedId;
            this.FuelSelectedId = searchModel.FuelSelectedId;
            this.IsAutomatic = searchModel.IsAutomatic;

            this.EngineSizeBracketSelectedId = searchModel.EngineSizeBracketSelectedId;

            this.NbRoomsBracketSelectedId = searchModel.NbRoomsBracketSelectedId;
            this.SelectedRealEstateTypeId = searchModel.SelectedRealEstateTypeId;
            this.SelectedDistrictId = searchModel.SelectedDistrictId;
            this.SurfaceAreaBracketSelectedId = searchModel.SurfaceAreaBracketSelectedId;
            this.IsFurnished = searchModel.IsFurnished;

            this.SelectedWaterTypeId = searchModel.SelectedWaterTypeId;
            this.SelectedMotorBoatTypeId = searchModel.SelectedMotorBoatTypeId;
            this.SelectedSailingBoatTypeId = searchModel.SelectedSailingBoatTypeId;
            this.SelectedHullTypeId = searchModel.SelectedHullTypeId;
            this.MinLength = searchModel.MinLength;
            this.MaxLength = searchModel.MaxLength;
            this.MinHp = searchModel.MinHp;
            this.MaxHp = searchModel.MaxHp;
            this.SelectedMotorTypeId = searchModel.SelectedMotorTypeId;
        }
Пример #3
0
        public AdvancedAdSearchModel(AdvancedAdSearchModel searchModel)
            : base(searchModel)
        {
            this.MinPrice = searchModel.MinPrice;
            this.MaxPrice = searchModel.MaxPrice;

            this.AgeBracketSelectedId = searchModel.AgeBracketSelectedId;
            this.KmBracketSelectedId  = searchModel.KmBracketSelectedId;

            this.BrandSelectedId = searchModel.BrandSelectedId;
            this.FuelSelectedId  = searchModel.FuelSelectedId;
            this.IsAutomatic     = searchModel.IsAutomatic;

            this.EngineSizeBracketSelectedId = searchModel.EngineSizeBracketSelectedId;

            this.NbRoomsBracketSelectedId     = searchModel.NbRoomsBracketSelectedId;
            this.SelectedRealEstateTypeId     = searchModel.SelectedRealEstateTypeId;
            this.SelectedDistrictId           = searchModel.SelectedDistrictId;
            this.SurfaceAreaBracketSelectedId = searchModel.SurfaceAreaBracketSelectedId;
            this.IsFurnished = searchModel.IsFurnished;

            this.SelectedWaterTypeId       = searchModel.SelectedWaterTypeId;
            this.SelectedMotorBoatTypeId   = searchModel.SelectedMotorBoatTypeId;
            this.SelectedSailingBoatTypeId = searchModel.SelectedSailingBoatTypeId;
            this.SelectedHullTypeId        = searchModel.SelectedHullTypeId;
            this.MinLength           = searchModel.MinLength;
            this.MaxLength           = searchModel.MaxLength;
            this.MinHp               = searchModel.MinHp;
            this.MaxHp               = searchModel.MaxHp;
            this.SelectedMotorTypeId = searchModel.SelectedMotorTypeId;
        }
Пример #4
0
        //
        // GET: /Search/
        public ActionResult Index(AdvancedAdSearchModel model)
        {
            ViewBag.Categories = _categoryServices.GetAllCategoriesOfAGroup(model.CategorySelectedId)
                .Select(x => new SelectListItem { Text = x.Label, Value = x.Id.ToString() });

            // Equivalent to Search/Search?
            if (model.CategorySelectedId.HasValue)
            {
                AdSearchResultModel result = _searchServices.SearchAds(model);
                return View(result);
            }
            // Equivalent to Search/QuickSearch? (when no categories)
            else
            {
                AdHomeSearchResultModel result = _searchServices.QuickSearch(model);
                return View("QuickSearch", result);
            }
        }
Пример #5
0
        //
        // GET: /Search/AddParamters
        public PartialViewResult AddParamters(int categoryId)
        {
            Category selectedCategory = _categoryServices.GetCategoryById(categoryId);
            FillViewLists(selectedCategory);
            AdvancedAdSearchModel model = new AdvancedAdSearchModel();

            switch (selectedCategory.Type)
            {
                case AdTypeEnum.CarAd:
                    return PartialView("Shared/_CarAdSearch", model);

                case AdTypeEnum.MotoAd:
                    return PartialView("Shared/_MotoAdSearch", model);

                case AdTypeEnum.VehiculeAd:
                    return PartialView("Shared/_VehicleAdSearch", model);

                case AdTypeEnum.OtherVehiculeAd:
                    return PartialView("Shared/_OtherVehicleAdSearch", model);

                case AdTypeEnum.RealEstateAd:
                    return PartialView("Shared/_RealEstateAdSearch", model);

                case AdTypeEnum.MotorBoatAd:
                    return PartialView("Shared/_MotorBoatAdSearch", model);

                case AdTypeEnum.SailingBoatAd:
                    return PartialView("Shared/_SailingBoatAdSearch", model);

                case AdTypeEnum.MotorBoatEngineAd:
                    return PartialView("Shared/_MotorBoatEngineAdSearch", model);

                case AdTypeEnum.WaterSportAd:
                    return PartialView("Shared/_WaterSportAdSearch", model);
            }

            return null;
        }
Пример #6
0
        private AdSearchParameters CreateSearchParameters(AdvancedAdSearchModel searchQuery)
        {
            AdSearchParameters parameters = new AdSearchParameters();

            if (!String.IsNullOrEmpty(searchQuery.SearchString))
                parameters.AndSearchStrings = searchQuery.SearchString.Trim().Split(' ');

            parameters.CategoryIds = GetCategoryIdsFromQuery(searchQuery.CategorySelectedId);
            parameters.CityId = searchQuery.CitySelectedId;

            parameters.MinPrice = searchQuery.MinPrice;
            parameters.MaxPrice = searchQuery.MaxPrice;

            // -- Vehicles specific properties -- //
            if (searchQuery.AgeBracketSelectedId.HasValue)
            {
                parameters.MaxYear = _referenceServices.GetAllAgeBrackets()[searchQuery.AgeBracketSelectedId.Value].LowValue;
                parameters.MaxYear = _helperService.GetCurrentDateTime().Year - parameters.MaxYear;
                parameters.MinYear = _referenceServices.GetAllAgeBrackets()[searchQuery.AgeBracketSelectedId.Value].HighValue;
                parameters.MinYear = _helperService.GetCurrentDateTime().Year - parameters.MinYear;
            }

            if (searchQuery.KmBracketSelectedId.HasValue)
            {
                parameters.MinKm = _referenceServices.GetAllKmBrackets()[searchQuery.KmBracketSelectedId.Value].LowValue;
                parameters.MaxKm = _referenceServices.GetAllKmBrackets()[searchQuery.KmBracketSelectedId.Value].HighValue;
            }

            if (searchQuery.EngineSizeBracketSelectedId.HasValue)
            {
                parameters.MinEngineSize = _referenceServices.GetAllEngineSizeBrackets()[searchQuery.EngineSizeBracketSelectedId.Value].LowValue;
                parameters.MaxEngineSize = _referenceServices.GetAllEngineSizeBrackets()[searchQuery.EngineSizeBracketSelectedId.Value].HighValue;
            }

            parameters.BrandId = searchQuery.BrandSelectedId;
            parameters.FueldId = searchQuery.FuelSelectedId;
            parameters.IsAuto = searchQuery.IsAutomatic;

            //-- Real Estate specific properties --//
            parameters.RealEstateTypeId = searchQuery.SelectedRealEstateTypeId;
            parameters.DistrictId = searchQuery.SelectedDistrictId;
            parameters.IsFurnished = searchQuery.IsFurnished;
            if (searchQuery.NbRoomsBracketSelectedId.HasValue)
            {
                parameters.MinNbRooms = _referenceServices.GetAllRealEstateNbRoomsBrackets()[searchQuery.NbRoomsBracketSelectedId.Value].LowValue;
                parameters.MaxNbRooms = _referenceServices.GetAllRealEstateNbRoomsBrackets()[searchQuery.NbRoomsBracketSelectedId.Value].HighValue;
            }
            if (searchQuery.SurfaceAreaBracketSelectedId.HasValue)
            {
                parameters.MinSurfaceArea = _referenceServices.GetAllSurfaceAreaBrackets()[searchQuery.SurfaceAreaBracketSelectedId.Value].LowValue;
                parameters.MaxSurfaceArea = _referenceServices.GetAllSurfaceAreaBrackets()[searchQuery.SurfaceAreaBracketSelectedId.Value].HighValue;
            }

            //-- Water sport specific properties --//
            parameters.MotorBoatTypeId = searchQuery.SelectedMotorBoatTypeId;
            parameters.MotorEngineTypeId = searchQuery.SelectedMotorTypeId;
            parameters.SailingBoatTypeId = searchQuery.SelectedSailingBoatTypeId;
            parameters.HullTypeId = searchQuery.SelectedHullTypeId;
            parameters.WaterTypeId = searchQuery.SelectedWaterTypeId;
            parameters.MinLength = searchQuery.MinLength;
            parameters.MaxLength = searchQuery.MaxLength;
            parameters.MinHp = searchQuery.MinHp;
            parameters.MaxHp = searchQuery.MaxHp;

            return parameters;
        }
Пример #7
0
        internal AdSearchResultModel AdvancedSearchAds(AdvancedAdSearchModel searchQuery)
        {
            // This search relies on a selected category
            Category selectedCategory = _repository.Get<Category>(searchQuery.CategorySelectedId);

            // create search parameters object from AdvancedAdSearchModel
            AdSearchParameters searchParameters = CreateSearchParameters(searchQuery);

            // call repo with Type T based on switch on category with parameters (same for all objects)
            IList<SearchAdCache> searchResult = new List<SearchAdCache>();

            switch (selectedCategory.Type)
            {
                case AdTypeEnum.CarAd:
                    searchResult = _searchRepository.AdvancedSearchAds<CarAd>(searchParameters);
                    break;
                case AdTypeEnum.OtherVehiculeAd:
                    searchResult = _searchRepository.AdvancedSearchAds<OtherVehicleAd>(searchParameters);
                    break;
                case AdTypeEnum.MotoAd:
                    searchResult = _searchRepository.AdvancedSearchAds<MotoAd>(searchParameters);
                    break;
                case AdTypeEnum.RealEstateAd:
                    searchResult = _searchRepository.AdvancedSearchAds<RealEstateAd>(searchParameters);
                    break;
                case AdTypeEnum.MotorBoatAd:
                    searchResult = _searchRepository.AdvancedSearchAds<MotorBoatAd>(searchParameters);
                    break;
                case AdTypeEnum.SailingBoatAd:
                    searchResult = _searchRepository.AdvancedSearchAds<SailingBoatAd>(searchParameters);
                    break;
                case AdTypeEnum.MotorBoatEngineAd:
                    searchResult = _searchRepository.AdvancedSearchAds<MotorBoatEngineAd>(searchParameters);
                    break;
                case AdTypeEnum.WaterSportAd:
                    searchResult = _searchRepository.AdvancedSearchAds<WaterSportAd>(searchParameters);
                    break;
                case AdTypeEnum.Ad:
                    searchResult = _searchRepository.AdvancedSearchAds<Ad>(searchParameters);
                    break;
            }

            // Create models for search results
            AdSearchResultModel model = new AdSearchResultModel(searchQuery);
            model.SearchResultTotalCount = searchResult.Count;
            model.SearchResult = searchResult.Select(a => new AdSearchResultItemModel(a)).ToList();

            return model;
        }
Пример #8
0
        public void SearchAds_CategoryIsSelected_CallAdRepoWithOneCategoryId()
        {
            // Given
            Category cat = new Category { Id = 12 };

            IList<SearchAdCache> searchResult = new List<SearchAdCache>();
            searchResult.Add(new SearchAdCache
            {
                Title = "ship",
                City = new City() { Label = "the city" },
                Category = cat
            });

            var adRepoMock = new Moq.Mock<ISearchRepository>();
            adRepoMock.Setup(r => r.SearchAds(new string[] { "ship" }, null, new int[] { 12 })).Returns(searchResult);

            var repoMock = new Moq.Mock<IRepository>();
            repoMock.Setup(r => r.Get<Category>(12)).Returns(cat);

            AdvancedAdSearchModel model = new AdvancedAdSearchModel()
            {
                SearchString = "ship",
                CategorySelectedId = 12
            };

            SearchServices service = new SearchServices(repoMock.Object, null, adRepoMock.Object, null, null, null);

            // When
            AdSearchResultModel result = service.LightSearchAds(model);

            // Then
            Assert.AreEqual("ship", result.SearchString);
            Assert.IsNull(result.CitySelectedId);
            Assert.AreEqual(12, result.CategorySelectedId);
            Assert.AreEqual(1, result.SearchResult.Count);
            Assert.AreEqual(1, result.SearchResultTotalCount);
            Assert.AreEqual("ship", result.SearchResult[0].Title);

            adRepoMock.VerifyAll();
        }
Пример #9
0
        public void SearchAds_2SearchString_CallAdRepoWithSeveralWords()
        {
            // Given
            IList<SearchAdCache> searchResult = new List<SearchAdCache>();
            searchResult.Add(new SearchAdCache
            {
                Title = "ship",
                City = new City() { Label = "the city" },
                Category = new Bea.Domain.Categories.Category()
            });
            searchResult.Add(new SearchAdCache
            {
                Title = "computer",
                City = new City() { Label = "the city" },
                Category = new Bea.Domain.Categories.Category()
            });

            var adRepoMock = new Moq.Mock<ISearchRepository>();
            adRepoMock.Setup(r => r.SearchAds(new string[] { "ship", "computer" }, 98, null)).Returns(searchResult);

            AdvancedAdSearchModel model = new AdvancedAdSearchModel()
            {
                SearchString = "ship computer",
                CitySelectedId = 98
            };

            SearchServices service = new SearchServices(null, null, adRepoMock.Object, null, null, null);

            // When
            AdSearchResultModel result = service.LightSearchAds(model);

            // Then
            Assert.AreEqual("ship computer", result.SearchString);
            Assert.AreEqual(98, result.CitySelectedId);
            Assert.AreEqual(2, result.SearchResult.Count);
            Assert.AreEqual(2, result.SearchResultTotalCount);
            Assert.AreEqual("ship", result.SearchResult[0].Title);
            Assert.AreEqual("computer", result.SearchResult[1].Title);

            adRepoMock.VerifyAll();
        }
Пример #10
0
        public void AdvancedSearchAds_SearchThroughWaterSportAds_CallSearchRepoOnWaterSportAds()
        {
            // Given
            Category cat = new Category { Id = 1, LabelUrlPart = "cat-url-label", Label = "Label", Type = AdTypeEnum.WaterSportAd };

            AdvancedAdSearchModel model = new AdvancedAdSearchModel()
            {
                CategorySelectedId = 1,
                SearchString = "kite",
                SelectedWaterTypeId = 9
            };

            IList<SearchAdCache> searchResult = new List<SearchAdCache>();
            searchResult.Add(new SearchAdCache
            {
                Title = "kite surf",
                City = new City() { Label = "the city" },
                Category = cat
            });

            var repoMock = new Moq.Mock<IRepository>();
            repoMock.Setup(r => r.Get<Category>(cat.Id)).Returns(cat);

            var searchRepoMock = new Moq.Mock<ISearchRepository>();
            searchRepoMock.Setup(r => r.AdvancedSearchAds<WaterSportAd>(
                It.Is<AdSearchParameters>(p =>
                    p.AndSearchStrings[0].Equals("kite")
                    && p.WaterTypeId == 9))).Returns(searchResult);

            SearchServices service = new SearchServices(repoMock.Object, null, searchRepoMock.Object, null, null, null);

            // When
            AdSearchResultModel result = service.AdvancedSearchAds(model);

            // Then
            Assert.AreEqual(1, result.SearchResultTotalCount);
        }
Пример #11
0
        public void AdvancedSearchAds_SearchThroughSailingBoatAds_CallSearchRepoOnSailingBoatAds()
        {
            // Given
            Category cat = new Category { Id = 1, LabelUrlPart = "cat-url-label", Label = "Label", Type = AdTypeEnum.SailingBoatAd };

            AdvancedAdSearchModel model = new AdvancedAdSearchModel()
            {
                CategorySelectedId = 1,
                SearchString = "voilier",
                AgeBracketSelectedId = 2,
                MinLength = 0,
                MaxLength = 13,
                SelectedSailingBoatTypeId = 6,
                SelectedHullTypeId = 2
            };

            IList<SearchAdCache> searchResult = new List<SearchAdCache>();
            searchResult.Add(new SearchAdCache
            {
                Title = "voilier",
                City = new City() { Label = "the city" },
                Category = cat
            });

            IDictionary<int, BracketItemReference> ageBr = new Dictionary<int, BracketItemReference>();
            ageBr.Add(2, new BracketItemReference { LowValue = 0, HighValue = 11 });

            var refMock = new Moq.Mock<IReferenceServices>();
            refMock.Setup(s => s.GetAllAgeBrackets()).Returns(ageBr);

            var repoMock = new Moq.Mock<IRepository>();
            repoMock.Setup(r => r.Get<Category>(cat.Id)).Returns(cat);

            var helperMock = new Moq.Mock<IHelperService>();
            helperMock.Setup(r => r.GetCurrentDateTime()).Returns(new DateTime(2013, 01, 01));

            var searchRepoMock = new Moq.Mock<ISearchRepository>();
            searchRepoMock.Setup(r => r.AdvancedSearchAds<SailingBoatAd>(
                It.Is<AdSearchParameters>(p =>
                    p.AndSearchStrings[0].Equals("voilier")
                    && p.MinLength == 0.0
                    && p.MaxLength == 13.0
                    && p.SailingBoatTypeId == 6
                    && p.HullTypeId == 2
                    && p.MinYear == 2002
                    && p.MaxYear == 2013))).Returns(searchResult);

            SearchServices service = new SearchServices(repoMock.Object, null, searchRepoMock.Object, helperMock.Object, refMock.Object, null);

            // When
            AdSearchResultModel result = service.AdvancedSearchAds(model);

            // Then
            Assert.AreEqual(1, result.SearchResultTotalCount);
        }
Пример #12
0
        public void AdvancedSearchAds_SearchThroughRealEstateAds_CallSearchRepoOnRealEstateAds()
        {
            // Given
            Category cat = new Category { Id = 1, LabelUrlPart = "cat-url-label", Label = "Label", Type = AdTypeEnum.RealEstateAd };

            AdvancedAdSearchModel model = new AdvancedAdSearchModel()
            {
                CategorySelectedId = 1,
                SearchString = "appart",
                NbRoomsBracketSelectedId = 2,
                SelectedDistrictId = 71,
                SelectedRealEstateTypeId = 2,
                MinPrice = 0,
                MaxPrice = 100000,
                SurfaceAreaBracketSelectedId = 3,
                IsFurnished = true
            };

            IList<SearchAdCache> searchResult = new List<SearchAdCache>();
            searchResult.Add(new SearchAdCache
            {
                Title = "appart",
                City = new City() { Label = "the city" },
                Category = cat
            });

            IDictionary<int, BracketItemReference> nbRoomsBr = new Dictionary<int, BracketItemReference>();
            nbRoomsBr.Add(2, new BracketItemReference { LowValue = 2, HighValue = 3 });

            IDictionary<int, BracketItemReference> surfBr = new Dictionary<int, BracketItemReference>();
            surfBr.Add(3, new BracketItemReference { LowValue = 45, HighValue = 70 });

            var refMock = new Moq.Mock<IReferenceServices>();
            refMock.Setup(s => s.GetAllRealEstateNbRoomsBrackets()).Returns(nbRoomsBr);
            refMock.Setup(s => s.GetAllSurfaceAreaBrackets()).Returns(surfBr);

            var repoMock = new Moq.Mock<IRepository>();
            repoMock.Setup(r => r.Get<Category>(cat.Id)).Returns(cat);

            var searchRepoMock = new Moq.Mock<ISearchRepository>();
            searchRepoMock.Setup(r => r.AdvancedSearchAds<RealEstateAd>(
                It.Is<AdSearchParameters>(p =>
                    p.AndSearchStrings[0].Equals("appart")
                    && p.MinNbRooms == 2
                    && p.MaxNbRooms == 3
                    && p.MinPrice == 0d
                    && p.MaxPrice == 100000d
                    && p.RealEstateTypeId == 2
                    && p.MinSurfaceArea == 45
                    && p.MaxSurfaceArea == 70
                    && p.IsFurnished.Value
                    && p.DistrictId == 71))).Returns(searchResult);

            SearchServices service = new SearchServices(repoMock.Object, null, searchRepoMock.Object, null, refMock.Object, null);

            // When
            AdSearchResultModel result = service.AdvancedSearchAds(model);

            // Then
            Assert.AreEqual(1, result.SearchResultTotalCount);
        }
Пример #13
0
        //
        // GET: /Search/Search
        public ActionResult Search(AdvancedAdSearchModel model)
        {
            ViewBag.Categories = _categoryServices.GetAllCategoriesOfAGroup(model.CategorySelectedId)
                .Select(x => new SelectListItem { Text = x.Label, Value = x.Id.ToString() });

            AdSearchResultModel result = _searchServices.SearchAds(model);

            return View("Index", result);
        }
        public void AdvancedAdSearchModelCopy_Ctorwithcopy()
        {
            // Given
            AdvancedAdSearchModel m = new AdvancedAdSearchModel
            {
                MinPrice = 1,
                MaxPrice = 2,

                AgeBracketSelectedId = 3,
                KmBracketSelectedId = 4,

                BrandSelectedId = 5,
                FuelSelectedId = 6,
                IsAutomatic = true,

                EngineSizeBracketSelectedId = 8,

                NbRoomsBracketSelectedId = 9,
                SelectedRealEstateTypeId = 10,
                SelectedDistrictId = 11,
                SurfaceAreaBracketSelectedId = 12,
                IsFurnished = true,

                SelectedHullTypeId = 13,
                SelectedWaterTypeId = 14,
                SelectedMotorBoatTypeId = 15,
                MinLength = 16,
                MaxLength = 17,
                MinHp = 18,
                MaxHp = 19,
                SelectedMotorTypeId = 20
            };

            // When
            AdvancedAdSearchModel actual = new AdvancedAdSearchModel(m);

            // Then
            Assert.AreEqual(actual.MinPrice, 1);
            Assert.AreEqual(actual.MaxPrice, 2);

            Assert.AreEqual(actual.AgeBracketSelectedId, 3);
            Assert.AreEqual(actual.KmBracketSelectedId, 4);

            Assert.AreEqual(actual.BrandSelectedId, 5);
            Assert.AreEqual(actual.FuelSelectedId, 6);
            Assert.IsTrue(actual.IsAutomatic.Value);

            Assert.AreEqual(actual.EngineSizeBracketSelectedId, 8);

            Assert.AreEqual(actual.NbRoomsBracketSelectedId, 9);
            Assert.AreEqual(actual.SelectedRealEstateTypeId, 10);
            Assert.AreEqual(actual.SelectedDistrictId, 11);
            Assert.AreEqual(actual.SurfaceAreaBracketSelectedId, 12);
            Assert.IsTrue(actual.IsFurnished.Value);

            Assert.AreEqual(actual.SelectedHullTypeId, 13);
            Assert.AreEqual(actual.SelectedWaterTypeId, 14);
            Assert.AreEqual(actual.SelectedMotorBoatTypeId, 15);
            Assert.AreEqual(actual.MinLength, 16);
            Assert.AreEqual(actual.MaxLength, 17);
            Assert.AreEqual(actual.MinHp, 18);
            Assert.AreEqual(actual.MaxHp, 19);
            Assert.AreEqual(actual.SelectedMotorTypeId, 20);
        }