예제 #1
0
		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");
		}
예제 #2
0
		public void SelectSearchOption(PollSearchOptionViewModel searchOption)
		{
			this.SelectedSearchOption = searchOption;
		}
예제 #3
0
		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;
		}
예제 #4
0
		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();
		}
예제 #5
0
		public void SelectSearchOption(PollSearchOptionViewModel searchOption)
		{
			this.SelectedSearchOption = searchOption;
		}