Esempio n. 1
0
        public async Task<PageResponse<LastAlbum>> SearchAsync(string albumname, int page = 1, int itemsPerPage = LastFm.DefaultPageLength)
        {
            var command = new SearchCommand(Auth, albumname)
            {
                Page = page,
                Count = itemsPerPage,
                HttpClient = HttpClient
            };

            return await command.ExecuteAsync();
        }
Esempio n. 2
0
        public async Task <PageResponse <LastTrack> > SearchAsync(string trackname, int page = 1, int itemsPerPage = LastFm.DefaultPageLength)
        {
            var command = new SearchCommand(Auth, trackname)
            {
                Page       = page,
                Count      = itemsPerPage,
                HttpClient = HttpClient
            };

            return(await command.ExecuteAsync());
        }
Esempio n. 3
0
    public async Task CanSearchOnNotFollowingLine()
    {
        var searchFolder = new FakeSearchFolder {
            SearchInFolder = GitHubFolder.FullName + @"\PureSearch\src\Test\"
        };
        var searchArguments = new FakeSearchArguments {
            MatchCase = false, NameContains = "Fake", SearchFor = "public class", TextThatFollows = "", TextThatDoesNotFollow = "Contains"
        };
        var searchCommand = new SearchCommand(searchFolder, searchArguments);
        var context       = new FakeApplicationCommandExecutionContext();
        await searchCommand.ExecuteAsync(context);

        Assert.IsTrue(context.Success);
        Assert.AreEqual(2, context.Messages.Count);
    }