Пример #1
0
        public void SendFile()
        {
            jfYuRequest jfYu = new jfYuRequest("https://img.nga.178.com/attachments/mon_201904/11/-7da9Q5-dgq4ZgT3cSzk-qo.jpg");

            jfYu.GetFile("d:/2.jpg", (q, w, e) => { });
            jfYu.GetFile("d:/3.jpg");
            Assert.IsTrue(File.Exists("d:/2.jpg"));
            Assert.IsTrue(File.Exists("d:/3.jpg"));
            Assert.AreEqual(File.ReadAllText("d:/2.jpg"), File.ReadAllText("d:/3.jpg"));
            File.Delete("d:/2.jpg");
            File.Delete("d:/3.jpg");
        }
Пример #2
0
        public void TestFile()
        {
            jfYuRequest jfYu = new jfYuRequest("https://img.nga.178.com/attachments/mon_201904/11/-7da9Q5-dgq4ZgT3cSzk-qo.jpg");

            jfYu.GetFile("d:/2.jpg");
            jfYu.GetFile("d:/3.jpg");
            Assert.True(File.Exists("d:/2.jpg"));
            Assert.True(File.Exists("d:/3.jpg"));
            Assert.Equal(File.ReadAllText("d:/2.jpg"), File.ReadAllText("d:/3.jpg"));
            var jfYu1 = new jfYuHttpClient("https://img.nga.178.com/attachments/mon_201904/11/-7da9Q5-dgq4ZgT3cSzk-qo.jpg");
            jfYu1.GetFile("d:/4.jpg");
            jfYu1.GetFile("d:/5.jpg");
            Assert.True(File.Exists("d:/4.jpg"));
            Assert.True(File.Exists("d:/5.jpg"));
            Assert.Equal(File.ReadAllText("d:/4.jpg"), File.ReadAllText("d:/5.jpg"));
            File.Delete("d:/2.jpg");
            File.Delete("d:/3.jpg");
            File.Delete("d:/4.jpg");
            File.Delete("d:/5.jpg");
        }