Exemple #1
0
        public async Task TestGetFollowers()
        {
            var client = new MastodonSharpClient(_Host, _AccessToken);
            var id     = _TestUserID;

            var stream = await client.GetPublicTimeline();

            Assert.IsTrue(stream.Content.Any());
        }
Exemple #2
0
        public async Task TestGetInstance()
        {
            var client = new MastodonSharpClient(_Host, _AccessToken);

            var result = await client.GetInstance();

            Assert.IsNotNull(result.Description);

            Assert.IsNotNull(result.Email);

            Assert.IsNotNull(result.Title);

            Assert.IsNotNull(result.Uri);

            Assert.IsNotNull(result.Version);
        }
Exemple #3
0
        public async Task TestRegister()
        {
            var client = new MastodonSharpClient(_Host, _AccessToken);

            var result = await client.Register("MastodonClient", OAuthScope.of(Scope.Read, Scope.Write, Scope.Follow));

            Assert.IsNotNull(result.Id);

            Assert.IsNotNull(result.ClientId);

            Assert.IsNotNull(result.ClientSecret);

            Assert.IsNotNull(result.AuthUrl);

            Assert.IsNotNull(result.RedirectUri);

            Assert.IsNotNull(result.Scope);

            Assert.IsNotNull(result.Instance);
        }
Exemple #4
0
        public async Task MyMute()
        {
            var client = new MastodonSharpClient(_Host, _AccessToken);
            var result = await client.Mute(_TestTargetUserId);

            Assert.IsNotNull(result.Blocking);

            Assert.IsNotNull(result.DomainBlocking);

            Assert.IsNotNull(result.FollowedBy);

            Assert.IsNotNull(result.Following);

            Assert.IsNotNull(result.Id);

            Assert.IsNotNull(result.Muting);

            Assert.IsNotNull(result.MutingBoosts);

            Assert.IsNotNull(result.Requested);

            await client.UnMute(_TestTargetUserId);
        }