Ejemplo n.º 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");
		}
Ejemplo n.º 2
0
		public void SelectSearchOption(PollSearchOptionViewModel searchOption)
		{
			this.SelectedSearchOption = searchOption;
		}
Ejemplo n.º 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;
		}
Ejemplo n.º 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();
		}
Ejemplo n.º 5
0
		public void SelectSearchOption(PollSearchOptionViewModel searchOption)
		{
			this.SelectedSearchOption = searchOption;
		}