コード例 #1
0
            public async Task NullSearchTermDefaultsToEmptyString()
            {
                var songs = new[] { new YoutubeSong("http://blabla", TimeSpan.Zero) };
                var cache = new InMemoryBlobCache();

                cache.InsertObject(BlobCacheKeys.GetKeyForYoutubeCache(string.Empty), songs);
                var finder = new YoutubeSongFinder(cache);

                var result = await finder.GetSongsAsync();

                Assert.Equal(1, result.Count);
            }
コード例 #2
0
            public async Task UsesCachedSongsIfAvailable()
            {
                const string searchTerm = "Foo";
                var          songs      = new[] { new YoutubeSong("http://blabla", TimeSpan.Zero) };
                var          cache      = new InMemoryBlobCache();

                cache.InsertObject(BlobCacheKeys.GetKeyForYoutubeCache(searchTerm), songs);
                var finder = new YoutubeSongFinder(cache);

                var result = await finder.GetSongsAsync(searchTerm);

                Assert.Equal(1, result.Count);
            }