Beispiel #1
0
        public void GetUserProfilePhotos_Returns()
        {
            User testUser = new User()
            {
                Id = 20793245
            };
            var m1 = _b.GetUserProfilePhotos(testUser);

            Assert.NotNull(m1);

            var count = m1.Count;

            //when the test user has more than 3 pics, we can additionally test the limit parameter
            if (m1.Count > 3)
            {
                var m2 = _b.GetUserProfilePhotos(testUser, 3);
                Assert.NotNull(m2);
                Assert.That(m2.Count == 3);
            }

            int cnt = 0;

            foreach (var x in m1)
            {
                _b.SendPhoto(_testMessage.Chat, new InputFile(x[0].FileId), caption: $"Photo {cnt}:{x[0].FileId}");
                cnt++;
                if (cnt > 4)
                {
                    break;
                }
            }
        }