Exemple #1
0
        public async Task SubmitQuery_NoQuery_DoesNothing()
        {
            var search   = new MockSearchService();
            var playback = new MockPlaybackService();

            search.GetFilteredSongsAsyncDelegate = MockGetFilteredSongsAsync;
            var viewModel = new MusicPageViewModel(search, playback);

            viewModel.Query = "";
            await viewModel.SubmitQuery();

            Assert.AreEqual(0, viewModel.Results.Count);
            Assert.IsFalse(viewModel.IsLoading);
        }
Exemple #2
0
        public async Task SubmitQuery_QueryPresent_CallsService()
        {
            var search   = new MockSearchService();
            var playback = new MockPlaybackService();

            search.GetFilteredSongsAsyncDelegate = MockGetFilteredSongsAsync;
            var viewModel = new MusicPageViewModel(search, playback);

            viewModel.Query = "bob";
            await viewModel.SubmitQuery();

            Assert.AreEqual(2, viewModel.Results.Count);
            Assert.AreEqual("One Love", viewModel.Results[0].Name);
            Assert.IsFalse(viewModel.IsLoading);
        }