public SearchPage() { this.InitializeComponent(); this.currentViewModel = new ViewModels.SearchViewModel(); this.DataContext = this.currentViewModel; }
public void FetchTrendingBeers() { var searchViewModel = new ViewModels.SearchViewModel(); var results = searchViewModel.TrendingBeers(10).Result; Assert.IsTrue(results.Count == 10); }
public void SearchForDuvel() { var searchViewModel = new ViewModels.SearchViewModel(); var results = searchViewModel.Search("duvel").Result; Assert.IsTrue(results.Count > 0, $"Number of beers returned: {results.Count}"); var duvel = results.FirstOrDefault(x => x.Id == "c8VKLu"); Assert.IsNotNull(duvel); }
public IActionResult Search(ViewModels.SearchViewModel search) { if (ModelState.IsValid) { var user = GetUser(); var client = new ApiClient(); return(Json(client.GetResponse(search, user))); } throw new Exception("Not valid"); }
public SearchResultsView() { this.InitializeComponent(); this.currentViewModel = new ViewModels.SearchViewModel(); this.DataContext = this.currentViewModel; Frame rootFrame = Window.Current.Content as Frame; var viewModel = this.DataContext as SearchViewModel; viewModel.Frame = rootFrame; }
public BasicSearch() { InitializeComponent(); p_vmSearch = (ViewModels.SearchViewModel)DataContext; }
public SearchPage() { BindingContext = new ViewModels.SearchViewModel(); InitializeComponent(); }