Пример #1
0
        public PlexApiTest()
        {
            var browserOpenerMock = new Mock <IBrowserOpener>();

            browserOpenerMock
            .Setup(mock => mock.OpenBrowser(It.IsAny <string>()))
            .Returns <string>(param => Task.CompletedTask);

            this.browserOpener = browserOpenerMock.Object;
        }
Пример #2
0
 public PlexClientApi(HttpClient client, IBrowserOpener browserOpener)
 {
     this.browserOpener = browserOpener;
     client.BaseAddress = new Uri("https://plex.tv");
     plexTvApiJson      = RestService.For <IPlexTvApi>(client);
     plexTvApiXml       = RestService.For <IPlexTvApi>(client, new RefitSettings
     {
         ContentSerializer = new XmlContentSerializer(
             new XmlContentSerializerSettings
         {
             XmlReaderWriterSettings = new XmlReaderWriterSettings()
             {
                 ReaderSettings = new XmlReaderSettings
                 {
                     IgnoreWhitespace = true
                 }
             }
         }
             )
     });
 }