public void AuthenticateTest()
        {
            var service = new ShowRssGlobalSubscriptionService(logger.Object, options.Object);

            service.Authenticate(out var result);
            Assert.Greater(result.AvailableShows.Count, 900);
        }
        public void ParseCsrfTokenTest()
        {
            var service = new ShowRssGlobalSubscriptionService(logger.Object, options.Object);
            var html    = TestHelper.GetRessourceContent("showRSS.html");
            var token   = service.ParseCsrfToken(html);

            Assert.AreEqual("Xe8AdkOS5vo11JjQSXVRbZ48e3I7bPGw6daYrEQy", token);
        }
        public void ParseSubscriptionsResultTest()
        {
            var service = new ShowRssGlobalSubscriptionService(logger.Object, options.Object);
            var html    = TestHelper.GetRessourceContent("showRSS.html");

            var result = service.ParseSubscriptionsResult(html);

            Assert.AreEqual(4, result.SubscribedShows.Count);
            Assert.AreEqual(988, result.AvailableShows.Count);
            Assert.IsTrue(result.SubscribedShows.Any(f => f.ShowTitle.Equals("game of thrones", StringComparison.InvariantCultureIgnoreCase)));
        }
        public void SubscribeUnsubscribeShowTest()
        {
            var service = new ShowRssGlobalSubscriptionService(logger.Object, options.Object);
            var context = service.Authenticate(out var initialResult);

            var show = initialResult.AvailableShows.Random();

            Assert.NotNull(show);

            // subscribe
            var afterSubscriptionResult = service.SubscribeToShow(context, show.ShowRssId);

            Assert.IsTrue(afterSubscriptionResult.Succeeded);

            // unsubscribe
            var afterUnsubscriptionResult = service.UnsubscribeToShow(context, show.ShowRssId);

            Assert.IsTrue(afterUnsubscriptionResult.Succeeded);
        }