Beispiel #1
0
        public void GetRecentMediaWithParameters()
        {
            try
            {
                // Get one user who follows you
                var followingUser = RelationshipsManager.GetFollowedBy().First();
                Assert.IsNotNull(followingUser);

                // Get his media using parameters
                var mediaFromFollower = UserManager.GetRecentMedia(new Parameters.UsersQueryParameters()
                {
                    Count = 5,
                    Id    = followingUser.Id
                });

                // Check the media
                Assert.IsNotNull(mediaFromFollower);
                Assert.AreEqual(5, mediaFromFollower.Count);
                Assert.IsTrue(mediaFromFollower.First().CreatedBy.Equals(followingUser));
            }
            catch (Exceptions.InstagramAPICallException)
            {
                Assert.Fail("instagram api call exception.");
            }
        }
        public void GetFollowersAndRelationshipInfo()
        {
            try
            {
                // Get followers
                var followers = RelationshipsManager.GetFollowedBy();
                Assert.IsNotNull(followers);

                // Get relationship info with the first user (for example)
                var relInfo = RelationshipsManager.GetRelationshipinfo(followers.First().Id);

                // Check if relationship info is correct
                // If the user is a follower the ingoing status must by followed_by
                Assert.IsNotNull(relInfo);
                Assert.AreEqual(IngoingRelationshipStatus.FollowedBy, relInfo.IngoingRelation);
            }
            catch (Exceptions.InstagramAPICallException)
            {
                Assert.Fail("Instagram Api error.");
            }
        }