コード例 #1
0
        public SearchPage()
        {
            this.InitializeComponent();

            this.currentViewModel = new ViewModels.SearchViewModel();
            this.DataContext = this.currentViewModel;
        }
コード例 #2
0
        public void FetchTrendingBeers()
        {
            var searchViewModel = new ViewModels.SearchViewModel();
            var results = searchViewModel.TrendingBeers(10).Result;

            Assert.IsTrue(results.Count == 10);
        }
コード例 #3
0
        public void FetchTrendingBeers()
        {
            var searchViewModel = new ViewModels.SearchViewModel();
            var results         = searchViewModel.TrendingBeers(10).Result;

            Assert.IsTrue(results.Count == 10);
        }
コード例 #4
0
        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);
        }
コード例 #5
0
 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");
 }
コード例 #6
0
        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);
        }
コード例 #7
0
        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;
        }
コード例 #8
0
 public BasicSearch()
 {
     InitializeComponent();
     p_vmSearch = (ViewModels.SearchViewModel)DataContext;
 }
コード例 #9
0
        public SearchPage()
        {
            BindingContext = new ViewModels.SearchViewModel();

            InitializeComponent();
        }