Example #1
0
 public void GetCurrentUser()
 {
     TestWrapper(async(TwitchConnection connection) =>
     {
         UserModel user = await UsersServiceUnitTests.GetCurrentUser(connection);
     });
 }
        public void GetBroadcasterSubscriptionPoints()
        {
            TestWrapper(async(TwitchConnection connection) =>
            {
                UserModel user = await UsersServiceUnitTests.GetCurrentUser(connection);

                long result = await connection.NewAPI.Subscriptions.GetBroadcasterSubscriptionPoints(user);

                Assert.IsTrue(result > 0);
            });
        }
Example #3
0
        public void GetChannelChatBadges()
        {
            TestWrapper(async(TwitchConnection connection) =>
            {
                UserModel user = await UsersServiceUnitTests.GetCurrentUser(connection);
                Assert.IsNotNull(user);

                IEnumerable <ChatBadgeSetModel> badges = await connection.NewAPI.Chat.GetChannelChatBadges(user);
                Assert.IsNotNull(badges);
                Assert.IsTrue(badges.Count() > 0);
            });
        }
        public void CreateAndGetClip()
        {
            TestWrapper(async(TwitchConnection connection) =>
            {
                UserModel user = await UsersServiceUnitTests.GetCurrentUser(connection);

                ClipCreationModel result = await connection.NewAPI.Clips.CreateClip(user);

                Assert.IsNotNull(result);
                Assert.IsNotNull(result.id);
            });
        }
        public void GetBroadcasterSubscriptions()
        {
            TestWrapper(async(TwitchConnection connection) =>
            {
                UserModel user = await UsersServiceUnitTests.GetCurrentUser(connection);

                IEnumerable <SubscriptionModel> results = await connection.NewAPI.Subscriptions.GetBroadcasterSubscriptions(user);

                Assert.IsNotNull(results);
                Assert.IsTrue(results.Count() > 0);
            });
        }
        public void GetChannelTeams()
        {
            TestWrapper(async(TwitchConnection connection) =>
            {
                UserModel user = await UsersServiceUnitTests.GetCurrentUser(connection);

                IEnumerable <TeamModel> results = await connection.NewAPI.Teams.GetChannelTeams(user);

                Assert.IsNotNull(results);
                Assert.IsTrue(results.Count() > 0);
            });
        }
        public void GetHypeTrainEvents()
        {
            TestWrapper(async(TwitchConnection connection) =>
            {
                UserModel channel = await UsersServiceUnitTests.GetCurrentUser(connection);

                IEnumerable <ChannelHypeTrainModel> results = await connection.NewAPI.Channels.GetHypeTrainEvents(channel);

                Assert.IsNotNull(results);
                Assert.IsTrue(results.Count() > 0);
            });
        }
        public void GetChannelInformation()
        {
            TestWrapper(async(TwitchConnection connection) =>
            {
                UserModel channel = await UsersServiceUnitTests.GetCurrentUser(connection);

                ChannelInformationModel result = await connection.NewAPI.Channels.GetChannelInformation(channel);

                Assert.IsNotNull(result);
                Assert.AreEqual(result.broadcaster_id, channel.id);
            });
        }
        public void GetFollowedStreams()
        {
            TestWrapper(async(TwitchConnection connection) =>
            {
                UserModel broadcaster = await UsersServiceUnitTests.GetCurrentUser(connection);

                IEnumerable <StreamModel> results = await connection.NewAPI.Streams.GetFollowedStreams(broadcaster);

                Assert.IsNotNull(results);
                Assert.IsTrue(results.Count() > 0);
            });
        }
        public void GetSchedule()
        {
            TestWrapper(async(TwitchConnection connection) =>
            {
                UserModel broadcaster = await UsersServiceUnitTests.GetCurrentUser(connection);

                ScheduleModel schedule = await connection.NewAPI.Schedule.GetSchedule(broadcaster, 5);

                Assert.IsNotNull(schedule);
                Assert.IsNotNull(schedule.segments);
                Assert.IsTrue(schedule.segments.Count > 0);
            });
        }
Example #11
0
        public void GetUserByLogin()
        {
            TestWrapper(async(TwitchConnection connection) =>
            {
                UserModel user = await UsersServiceUnitTests.GetCurrentUser(connection);

                UserModel result = await connection.NewAPI.Users.GetUserByLogin("SaviorXTanren");

                Assert.IsNotNull(result);
                Assert.IsNotNull(result.id);
                Assert.AreEqual(user.id, result.id);
            });
        }
Example #12
0
        public void UpdateCurrentUserDescription()
        {
            TestWrapper(async(TwitchConnection connection) =>
            {
                UserModel user = await UsersServiceUnitTests.GetCurrentUser(connection);

                string newDescription = "This is a test description update at " + DateTimeOffset.Now.ToString();
                UserModel result      = await connection.NewAPI.Users.UpdateCurrentUserDescription(newDescription);

                Assert.IsNotNull(result);
                Assert.IsNotNull(result.id);
                Assert.AreEqual(user.id, result.id);
                Assert.AreEqual(result.description, newDescription);
            });
        }
        public void GetSpecificBroadcasterSubscriptions()
        {
            TestWrapper(async(TwitchConnection connection) =>
            {
                UserModel broadcaster = await UsersServiceUnitTests.GetCurrentUser(connection);
                UserModel user        = await connection.NewAPI.Users.GetUserByLogin("Ninja");

                IEnumerable <SubscriptionModel> results = await connection.NewAPI.Subscriptions.GetBroadcasterSubscriptions(broadcaster, new List <string>()
                {
                    user.id
                });

                Assert.IsNotNull(results);
                Assert.IsTrue(results.Count() > 0);
            });
        }
        public void GetTeam()
        {
            TestWrapper(async(TwitchConnection connection) =>
            {
                UserModel user = await UsersServiceUnitTests.GetCurrentUser(connection);

                IEnumerable <TeamModel> results = await connection.NewAPI.Teams.GetChannelTeams(user);

                Assert.IsNotNull(results);
                Assert.IsTrue(results.Count() > 0);

                TeamDetailsModel team = await connection.NewAPI.Teams.GetTeam(results.First().id);

                Assert.IsNotNull(team);
                Assert.AreEqual(results.First().id, team.id);
            });
        }
Example #15
0
        public void UpdateStreamTags()
        {
            TestWrapper(async(TwitchConnection connection) =>
            {
                IEnumerable <TagModel> tags = await connection.NewAPI.Tags.GetStreamTags();

                UserModel user = await UsersServiceUnitTests.GetCurrentUser(connection);

                await connection.NewAPI.Tags.UpdateStreamTags(user);

                IEnumerable <TagModel> results = await connection.NewAPI.Tags.GetStreamTagsForBroadcaster(user);

                Assert.IsNotNull(results);
                Assert.IsTrue(results.Count() == 0);

                await connection.NewAPI.Tags.UpdateStreamTags(user, tags.Take(3));

                results = await connection.NewAPI.Tags.GetStreamTagsForBroadcaster(user);

                Assert.IsNotNull(results);
                Assert.IsTrue(results.Count() == 3);
            });
        }