public ListingsController(IRepository <ListingsViewModel> listingsRepo, IRepository <CalendarViewModel> calendarRepo, IDistributedCache cache) { _listingsRepo = listingsRepo; _calendarRepo = calendarRepo; _cache = new CacheHelper(cache); _validator = new FilterValidator(); }
public void DefaultValidation_FilterWithZeroOrNegativeId_ShouldThrowException(int id) { IValidator <Filter> validator = new FilterValidator(); var filter = new Filter { MarketId = id }; Action action = () => validator.DefaultValidation(filter); action.Should().Throw <ArgumentException>() .WithMessage("MarketId cannot be less than 1. (Parameter 'id')"); }