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

            if (m1.Count > 0)
            {
                var result = _b.GetFile(m1[0][0].FileId);
                Assert.NotNull(result);
                Assert.NotNull(result.FileId);
                Assert.NotNull(result.FilePath);
                Assert.NotNull(result.FileSize);
                var bytes = _b.GetFileContent(result);
                Assert.NotNull(bytes);
                Assert.That(bytes.Length > 0);
                var m2 = _b.SendDocument(_testMessage.Chat, new InputFile(bytes, "fileTransferTest", "img/jpeg"));
                Assert.NotNull(m2);
                Assert.NotNull(m2.Document);
            }
        }