Exemplo n.º 1
0
        static TVDBInfo GetTVDBInfo()
        {
            string   filePath = GetTVDBInfoFilePath();
            TVDBInfo tvdbInfo = TVDBInfo.ReadFromFile(filePath);

            return(tvdbInfo);
        }
Exemplo n.º 2
0
        public void ReadFromFile_InvalidFile_ThrowsException()
        {
            string filePath = @"c:\tempobox\tvdbinfo.json";

            // Assert
            Assert.Throws <FileNotFoundException>(() => TVDBInfo.ReadFromFile(filePath));
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
        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);
        }
Exemplo n.º 5
0
        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);
        }
Exemplo n.º 6
0
 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);
 }