Пример #1
0
        public void Setup()
        {
            this.applicationHost = new TestApplicationHost();
            var applicationPaths = this.applicationHost.Resolve <IApplicationPaths>();

            var plugin = new Plugin(applicationPaths,
                                    this.applicationHost.Resolve <IXmlSerializer>());

            plugin.SetConfiguration(new PluginConfiguration
            {
                TvDbApiKey = Secrets.TvDbApiKey
            });

            // pre-populate the cache to avoid spamming AniDb with requests when the tests run
            // (and for static test data)
            FileCacheHelper.SetupCachedFile(applicationPaths.CachePath, @"\anidb\titles.xml",
                                            @"\anidb\titles\titles.xml");

            FileCacheHelper.SetupCachedFile(applicationPaths.CachePath, @"\anidb\959.xml",
                                            @"\anidb\series\959\series.xml");

            FileCacheHelper.SetupCachedFile(applicationPaths.CachePath, @"\TvDb\78914.json", @"\anidb\tvdb\78914.json");

            FileCacheHelper.SetupCachedFile(applicationPaths.CachePath, @"\Mappings\anime-list.xml",
                                            @"\anime-list.xml");

            FileCacheHelper.SetupCachedFile(applicationPaths.CachePath, @"\anidb\10145.xml",
                                            @"\anidb\season\10145\season.xml");
            FileCacheHelper.SetupCachedFile(applicationPaths.CachePath, @"\anidb\10145.xml",
                                            @"\anidb\series\10145\series.xml");

            FileCacheHelper.SetupCachedFile(applicationPaths.CachePath, @"\TvDb\278157.json", @"\anidb\tvdb\278157.json");
        }