private static async void TestSearchAnimeAsync(ICredentialContext credential) { var asyncAnimeSearcher = new AnimeSearchMethodsAsync(credential); var response = await asyncAnimeSearcher.SearchAsync("Naruto"); Console.WriteLine(response); }
public bool reloadClient() { var malCredentials = _redis.HashGetAll("malCredentials"); if (malCredentials.Length != 0) { _credentials = new CredentialContext(); foreach (var c in malCredentials) { switch (c.Name) { case "Username": _credentials.UserName = c.Value; break; case "Password": _credentials.Password = c.Value; break; } } _animeSearch = new AnimeSearchMethodsAsync(_credentials); _mangaSearch = new MangaSearchMethodsAsync(_credentials); _logger.Verbose($"[Geekbot] [MalClient] Logged in to Mal"); return(true); } _logger.Warning("[Geekbot] [MalClient] No Credentials Set!"); return(false); }
private static void TestAddAnime(ICredentialContext credential) { var methods = new AnimeListMethods(credential); var responseText = methods.AddAnime(ANIME_ID, _animeData); Console.WriteLine(responseText); }
private static async void TestSearchMangaAsync(ICredentialContext credential) { var asyncMangaSearcher = new MangaSearchMethodsAsync(credential); MangaSearchResponse response = await asyncMangaSearcher.SearchDeserializedAsync("Dagashi Kashi"); Console.WriteLine(response.ToJson()); Console.WriteLine(response.ToXml()); }
private static void TestAddAnimeByObject(ICredentialContext credential) { var methods = new AnimeListMethods(credential); var animeValues = new AnimeValues { AnimeStatus = AnimeStatus.Watching, Comments = "It was a great series." }; var responseText = methods.AddAnime(ANIME_ID, animeValues); Console.WriteLine(responseText); }
private static void TestAddMangaByObject(ICredentialContext credential) { var methods = new MangaListMethods(credential); var mangaValues = new MangaValues { MangaStatus = MangaStatus.Reading, Comments = "I am planning to read this" }; var responseText = methods.AddManga(MANGA_ID, mangaValues); Console.WriteLine(responseText); }
private static void TestSearch(ICredentialContext credential) { //// Step 1: Enter UserName and Password information //ICredentialContext credential = new CredentialContext //{ // UserName = "******", // Password = "******" //}; // Step 2: Create a method object var searchMethods = new SearchMethods(credential); // Step 3: Search using the search term ("Full Metal" in this case) string mangaResponse = searchMethods.SearchManga("Code Geass"); Console.WriteLine(mangaResponse); // Step 3: Search using the search term ("Full Metal" in this case) string animeResponse = searchMethods.SearchAnime("Full Metal"); Console.WriteLine(animeResponse); }
public UpdateMangaRequestParameters(ICredentialContext credential, int? id, string data) : base(credential, id, data) { }
/// <remarks> /// Data is not required for deleting a manga entry /// </remarks> public DeleteMangaRequestParameters(ICredentialContext credential, int?id) : base(credential, id, null) { }
public MangaListMethodsAsync(ICredentialContext credentialContext) : base(credentialContext) { }
protected SearchRequestParameters(ICredentialContext credential, string searchTerm) : base(credential) { SearchTerm = searchTerm; }
protected CrudRequestParameters(ICredentialContext credential, int?id, string data) : base(credential, id) { Data = data; }
protected RequestParameters(ICredentialContext credential, int?id = null) { Credential = credential; Id = id; }
public DeleteAnimeRequestParameters(ICredentialContext credential, int?id, string data = "") : base(credential, id, data) { }
protected RequestParameters(ICredentialContext credential, int? id = null) { Credential = credential; Id = id; }
public MangaSearchRequestParameters(ICredentialContext credentialContext, string searchTerm) : base(credentialContext, searchTerm) { }
public UpdateMangaRequestParameters(ICredentialContext credential, int?id, string data) : base(credential, id, data) { }
private static void TestAddManga(ICredentialContext credential) { var methods = new MangaListMethods(credential); methods.AddManga(MANGA_ID, _mangaData); }
protected MyAnimeListMethods(ICredentialContext credentialContext) { CredentialContext = credentialContext; }
private static void TestCredentials(ICredentialContext credential) { string responseFromServer = new AccountMethods(credential).VerifyCredentials(); Console.WriteLine(responseFromServer); }
public AnimeSearchRequestParameters(ICredentialContext credentialContext, string searchTerm) : base(credentialContext, searchTerm) { }
public AnimeListMethods(ICredentialContext credentialContext) : base(credentialContext) { }
public AddAnimeRequestParameters(ICredentialContext credentialContext, int?id, string data) : base(credentialContext, id, data) { }
public AnimeSearchMethodsAsync(ICredentialContext credentialContext) : base(credentialContext) { }
public CredentialContextFixture() { CredentialContext = new CredentialContext(); }
public SearchMethods(ICredentialContext credentialContext) : base(credentialContext) { }
public VerifyCredentialsRequestParameters(ICredentialContext credential) : base(credential) { Credential = credential; }
/// <remarks> /// Data is not required for deleting a manga entry /// </remarks> public DeleteMangaRequestParameters(ICredentialContext credential, int? id) : base(credential, id, null) { }
public AddAnimeRequestParameters(ICredentialContext credentialContext, int? id, string data) : base(credentialContext, id, data) { }
public MangaSearchMethodsAsync(ICredentialContext credentialContext) : base(credentialContext) { }
public AccountMethodsAsync(ICredentialContext credentialContext) : base(credentialContext) { }
protected CrudRequestParameters(ICredentialContext credential, int? id, string data) : base(credential, id) { Data = data; }
public DeleteAnimeRequestParameters(ICredentialContext credential, int? id, string data = "") : base(credential, id, data) { }