static TVDBInfo GetTVDBInfo() { string filePath = GetTVDBInfoFilePath(); TVDBInfo tvdbInfo = TVDBInfo.ReadFromFile(filePath); return(tvdbInfo); }
public void ReadFromFile_InvalidFile_ThrowsException() { string filePath = @"c:\tempobox\tvdbinfo.json"; // Assert Assert.Throws <FileNotFoundException>(() => TVDBInfo.ReadFromFile(filePath)); }
static void ReadTVDBInfo() { string filePath = GetTVDBInfoFilePath(); TVDBInfo tvdbInfo = TVDBInfo.ReadFromFile(filePath); tvdbInfo.TokenRetrievedDate = DateTime.Now.AddDays(-1); Console.WriteLine($"apiKey from TVDBInfo: {tvdbInfo.ApiKey}. DateTime: {tvdbInfo.TokenRetrievedDate}"); tvdbInfo.SaveToFile(filePath); }
public void ReadFromFile_ValidFile_Passes() { string filePath = @"c:\temp\tvdbinfo.json"; string expectedApiKey = "URV9WXPTFX8R9J6A"; // Act TVDBInfo tvdbInfo = TVDBInfo.ReadFromFile(filePath); // Assert Assert.Equal(expectedApiKey, tvdbInfo.ApiKey); }
public void ToAuthenticator_Valid_ReturnsAuthenticator() { string filePath = @"c:\temp\tvdbinfo.json"; string expectedApiKey = "URV9WXPTFX8R9J6A"; string expectedUserKey = "6U0AVI208RGC9EWE"; string expectedUsername = "******"; // Act TVDBInfo tvdbInfo = TVDBInfo.ReadFromFile(filePath); TVDBAuthenticator authenticator = tvdbInfo.ToAuthenticator(); Assert.Equal(expectedApiKey, authenticator.ApiKey); Assert.Equal(expectedUserKey, authenticator.UserKey); Assert.Equal(expectedUsername, authenticator.Username); }
public RenamerFacade(TVDBRetrieverService retrieverService, TVShowService showService, EpisodeService episodeService, LocalMediaService localService, EpisodeContext context, IRenamePrompter prompter, string tvdbPath) { _retrieverService = retrieverService; _showService = showService; _episodeService = episodeService; _localservice = localService; _context = context; _tvdbInfoFilePath = tvdbPath; _prompter = prompter; _tvdbInfo = TVDBInfo.ReadFromFile(_tvdbInfoFilePath); }