public void OnlyBrandNew_ShouldBe_TypeOfBool() { var rim = new RimsWithTiresSearchModel(); var result = rim.OnlyBrandNew.GetType(); Assert.True(result == typeof(bool)); }
private IQueryable <RimWithTire> CentralHoleSizeFilter(RimsWithTiresSearchModel searchModel, IQueryable <RimWithTire> rims) { if (searchModel.CentralHoleSize != null) { rims = rims.Where(x => x.CentralHoleSize == searchModel.CentralHoleSize); } return(this.NumberOfBoltsFilter(searchModel, rims)); }
private IQueryable <RimWithTire> SeasonFilter(RimsWithTiresSearchModel searchModel, IQueryable <RimWithTire> rims) { if (searchModel.Season != null) { rims = rims.Where(x => x.Season == searchModel.Season); } return(this.BrandFilter(searchModel, rims)); }
private IQueryable <RimWithTire> WeightIndexFilter(RimsWithTiresSearchModel searchModel, IQueryable <RimWithTire> rims) { if (searchModel.WeightIndex != null) { rims = rims.Where(x => x.WeightIndex == searchModel.WeightIndex); } return(this.GrappleMmFilter(searchModel, rims)); }
public void Size_ShouldBe_TypeOfDouble() { var rim = new RimsWithTiresSearchModel(); rim.Size = 1; var result = rim.Size.GetType(); Assert.True(result == typeof(double)); }
public void PriceTo_ShouldBe_TypeOfDecimal() { var rim = new RimsWithTiresSearchModel(); rim.PriceTo = 1; var result = rim.PriceTo.GetType(); Assert.True(result == typeof(decimal)); }
public void QuantityFrom_ShouldBe_TypeOfInt() { var rim = new RimsWithTiresSearchModel(); rim.QuantityFrom = 1; var result = rim.QuantityFrom.GetType(); Assert.True(result == typeof(int)); }
public void Siting_ShouldBe_TypeOfString(string test) { var bm = new RimsWithTiresSearchModel(); bm.Siting = test; var result = bm.Siting.GetType(); Assert.True(result == typeof(string)); }
public void GrappleMm_ShouldBe_TypeOfDouble() { var rim = new RimsWithTiresSearchModel(); rim.GrappleFrom = 1; var result = rim.GrappleFrom.GetType(); Assert.True(result == typeof(double)); }
public void WeightIndex_ShouldBe_TypeOfString(string test) { var bm = new RimsWithTiresSearchModel(); bm.WeightIndex = test; var result = bm.WeightIndex.GetType(); Assert.True(result == typeof(string)); }
public void SpeedIndex_ShouldBe_TypeOfInt() { var rim = new RimsWithTiresSearchModel(); rim.SpeedIndexFrom = 1; var result = rim.SpeedIndexFrom.GetType(); Assert.True(result == typeof(int)); }
public void NumberBolts_ShouldBe_TypeOfInt() { var rim = new RimsWithTiresSearchModel(); rim.NumberOfBolts = 1; var result = rim.NumberOfBolts.GetType(); Assert.True(result == typeof(int)); }
public void SpaceBetweenBolts_ShouldBe_TypeOfDouble() { var rim = new RimsWithTiresSearchModel(); rim.SpaceBetweenBolts = 1; var result = rim.SpaceBetweenBolts.GetType(); Assert.True(result == typeof(double)); }
private IQueryable <RimWithTire> GrappleMmFilter(RimsWithTiresSearchModel searchModel, IQueryable <RimWithTire> rims) { if (searchModel.GrappleFrom != null) { rims = rims.Where(x => x.GrappleMm >= searchModel.GrappleFrom); } return(this.SeasonFilter(searchModel, rims)); }
private IQueryable <RimWithTire> SpeedIndexFilter(RimsWithTiresSearchModel searchModel, IQueryable <RimWithTire> rims) { if (searchModel.SpeedIndexFrom != null) { rims = rims.Where(x => x.SpeedIndex >= searchModel.SpeedIndexFrom); } return(this.WeightIndexFilter(searchModel, rims)); }
private IQueryable <RimWithTire> PriceToFilter(RimsWithTiresSearchModel searchModel, IQueryable <RimWithTire> rims) { if (searchModel.PriceTo != null) { rims = rims.Where(x => x.Price <= searchModel.PriceTo); } return(this.OnlyBrandNewFilter(searchModel, rims)); }
private IQueryable <RimWithTire> OnlyBrandNewFilter(RimsWithTiresSearchModel searchModel, IQueryable <RimWithTire> rims) { if (searchModel.OnlyBrandNew) { rims = rims.Where(x => x.IsBrandNew); } return(rims); }
private IQueryable <RimWithTire> SizeFilter(RimsWithTiresSearchModel searchModel, IQueryable <RimWithTire> rims) { if (searchModel.Size != null) { rims = rims.Where(x => x.Size == searchModel.Size); } return(this.PriceFromFilter(searchModel, rims)); }
private IQueryable <RimWithTire> PriceFromFilter(RimsWithTiresSearchModel searchModel, IQueryable <RimWithTire> rims) { if (searchModel.PriceFrom != null) { rims = rims.Where(x => x.Price >= searchModel.PriceFrom); } return(this.PriceToFilter(searchModel, rims)); }
private IQueryable <RimWithTire> WidthFilter(RimsWithTiresSearchModel searchModel, IQueryable <RimWithTire> rims) { if (searchModel.Width != null) { rims = rims.Where(x => x.Width == searchModel.Width); } return(this.CentralHoleSizeFilter(searchModel, rims)); }
private IQueryable <RimWithTire> SpaceBetweenBoltsFilter(RimsWithTiresSearchModel searchModel, IQueryable <RimWithTire> rims) { if (searchModel.SpaceBetweenBolts != null) { rims = rims.Where(x => x.SpaceBetweenBolts == searchModel.SpaceBetweenBolts); } return(this.SizeFilter(searchModel, rims)); }
private IQueryable <RimWithTire> QuantityFromFilter(RimsWithTiresSearchModel searchModel, IQueryable <RimWithTire> rims) { if (searchModel.QuantityFrom != null) { rims = rims.Where(x => x.Quantity >= searchModel.QuantityFrom); } return(this.WidthFilter(searchModel, rims)); }
private IQueryable <RimWithTire> SitingFilter(RimsWithTiresSearchModel searchModel, IQueryable <RimWithTire> rims) { if (!string.IsNullOrWhiteSpace(searchModel.Siting)) { rims = rims.Where(x => x.Siting.ToLower().Contains(searchModel.Siting.ToLower())); } return(this.QuantityFromFilter(searchModel, rims)); }
private IQueryable <RimWithTire> BrandFilter(RimsWithTiresSearchModel searchModel, IQueryable <RimWithTire> rims) { if (!string.IsNullOrWhiteSpace(searchModel.Brand)) { rims = rims.Where(x => x.Brand.ToLower().Contains(searchModel.Brand.ToLower())); } return(this.ModelFilter(searchModel, rims)); }
public ActionResult SearchingNextFive(RimsWithTiresSearchModel rim, int page) { var tires = this.rimWithTireService.GetNextFive(rim, page).To <ListingTireWithRimViewModel>().ToList(); return(PartialView("PartialRimsWithTires", tires)); }
private IQueryable <RimWithTire> Filter(RimsWithTiresSearchModel searchModel) { var rimsWithTires = this.rimWithTireRepo.All(); return(this.DotFromFilter(searchModel, rimsWithTires).OrderBy(x => x.Brand)); }
public IQueryable <RimWithTire> GetFirstFive(RimsWithTiresSearchModel searchModel) { return(this.Filter(searchModel).Take(5)); }
public IQueryable <RimWithTire> GetNextFive(RimsWithTiresSearchModel searchModel, int page) { return(this.Filter(searchModel).Skip(page * 5).Take(5)); }
public ActionResult Searching(RimsWithTiresSearchModel rimWithTire) { var rimsWithTires = this.rimWithTireService.GetFirstFive(rimWithTire).To <ListingTireWithRimViewModel>().ToList(); return(View("ListingRimWithTire", rimsWithTires)); }
public ActionResult Search(RimsWithTiresSearchModel rimWithTire) { return(RedirectToAction("Searching", rimWithTire)); }