Example #1
0
        public async void TestGetWebhookSubscriptions()
        {
            var mockHandler = HelixSetup.GetMockHttpCallHandler(GetWebhookSubscriptionsResponseJson);
            var api         = new TwitchAPI(http: mockHandler.Object);
            var result      = await api.Helix.Webhooks.GetWebhookSubscriptionsAsync(accessToken : "RandomTokenThatDoesntMatter");

            Assert.True(result.Total == 12);
            Assert.Contains(result.Subscriptions, x => x.Callback == "http://example.com/your_callback");
        }
Example #2
0
        public async void TestGetBitsLeaderboards()
        {
            var mockHandler = HelixSetup.GetMockHttpCallHandler(GetGetBitsLeaderboardResponse);
            var api         = TwitchLibMock.TwitchApi(mockHandler);
            var result      = await api.Helix.Bits.GetBitsLeaderboardAsync(accessToken : "RandomTokenThatDoesntMatter");

            Assert.True(result.Total == 2);
            Assert.Contains(result.Listings, x => x.UserId == "158010205");
        }
Example #3
0
        public async void TestGetClips()
        {
            var mockHandler = HelixSetup.GetMockHttpCallHandler(GetClipsResponse);
            var api         = new TwitchAPI(http: mockHandler.Object);
            var result      = await api.Helix.Clips.GetClipsAsync(new System.Collections.Generic.List <string> {
                "AwkwardHelplessSalamanderSwiftRage"
            });

            Assert.True(result.Clips[0].VideoId == "205586603");
        }
Example #4
0
        public async void TestGetGameAnalytics()
        {
            var mockHandler = HelixSetup.GetMockHttpCallHandler(GetGameAnalyticsResponse);
            var api         = TwitchLibMock.TwitchApi(mockHandler);

            var result = await api.Helix.Analytics.GetGameAnalyticsAsync("493057", "RandomTokenThatDoesntMatter");

            Assert.True(result.Data[0].Type == "overview_v2");
            Assert.True(result.Data[0].GameId == "493057");
        }