public void ApplyFilters_Name_ABCD_ExpectFalse() { Predicate <PieceOfClothing> test = new Predicate <PieceOfClothing>(x => x.Name == "ABCDE"); FilteringConditions filtering = new FilteringConditions() { Name = "new", Conditions = test }; var result = filtering.ApplyFilters(mockInputList); Assert.AreEqual(result.Count, 0); }
public void ApplyFilters_ParameterNotExistent_ExpectFalse() { Predicate <PieceOfClothing> test = new Predicate <PieceOfClothing>(x => x.Name == "ABC"); FilteringConditions filtering = new FilteringConditions() { Name = "new", Conditions = test }; var result = filtering.ApplyFilters(mockNullNameList); Assert.AreEqual(result.Count, 0); }
public FilteringService(IEventAggregator eventAggregator, ITypeFilteringConditionsService typeFilteringConditionsService) { this.eventAggregator = eventAggregator; this.typeFilteringConditionsService = typeFilteringConditionsService; FilterTabs = FilteringSortingConditions.GenerateStandardConditions(); currentFilter = FilterTabs[0]; TypesFilterList = typeFilteringConditionsService.Conditions; typeFilteringConditionsService.FilteringConditionsUpdated += TypeFilteringConditionsService_FilteringConditionsUpdated; currentTypeFilter = TypesFilterList[0]; }
public void RefreshTypeFiltering(FilteringConditions filter) { currentTypeFilter = filter; eventAggregator.GetEvent <RefreshClothesFilteringEvent>().Publish(); }
private void TypeFilteringConditionsService_FilteringConditionsUpdated(object sender, EventArgs e) { TypesFilterList = typeFilteringConditionsService.Conditions; currentTypeFilter = TypesFilterList[0]; TypesFilterListUpdated(this, new EventArgs()); }
private void OnTypeFilterChanged(FilteringConditions obj) { filteringService.RefreshTypeFiltering(SelectedTypeFilter); }
private void OnFilterChanged(FilteringConditions obj) { InvokePropertyChanged("SelectedFilter"); filteringService.RefreshFiltering(SelectedFilter); }