public void SelectedSearchOption() { // Arrange var viewModel = GetViewModel(); var wasSearchExecuted = false; ObjectFactory.FetchAsyncWithCriteriaDelegate = (criteria) => { wasSearchExecuted = true; return new PollSearchResultsMock(); }; var expectedSearchOption = new PollSearchOptionViewModel(); // Act viewModel.PropertyChanged += OnPropertyChanged; viewModel.SelectedSearchOption = expectedSearchOption; viewModel.PropertyChanged -= OnPropertyChanged; // Assert Assert.AreSame(expectedSearchOption, viewModel.SelectedSearchOption, "Selected Search Option"); Assert.IsTrue(PropertiesChanged.Contains("SelectedSearchOption"), "Property Changed"); Assert.IsTrue(wasSearchExecuted, "Was Search Executed"); }
public void SelectSearchOption(PollSearchOptionViewModel searchOption) { this.SelectedSearchOption = searchOption; }
public void SelectSearchOption(PollSearchOptionViewModel searchOption) { this.SelectedSearchOption = searchOption; bool queryMode = this.SelectedSearchOption.Display == "Keyword Search Result"; mSearchText.Visibility = queryMode ? ViewStates.Visible : ViewStates.Invisible; if (!queryMode) mSearchText.Text = string.Empty; }
private void PopulateFilterOptions(bool keywordSearch) { //if (!keywordSearch) { this.SearchOptions.Add(new PollSearchOptionViewModel { Display = "Most Popular", QueryType = PollSearchResultsQueryType.MostPopular }); this.SearchOptions.Add(new PollSearchOptionViewModel { Display = "By Date (Newest First)", QueryType = PollSearchResultsQueryType.Newest }); } //else { this.SearchOptions.Add(new PollSearchOptionViewModel { Display = "Keyword Search Result", QueryType = PollSearchResultsQueryType.Newest }); } this.SelectedSearchOption = this.SearchOptions.Last(); }