コード例 #1
0
        public async Task DownloadFileNamesTest()
        {
            var json     = "{ \"Files\":[\"test.pdf\",\"test.txt\"],\"ErrorMessage\":null}";
            var response = new HttpResponseMessage
            {
                StatusCode = HttpStatusCode.OK,
                Content    =
                    new StringContent(json),
            };

            httpFake
            .Setup(
                x => x.GetAsync((It.IsAny <string>())))

            .Returns(Task.FromResult <HttpResponseMessage>(response));

            service = new DownloadService(httpFake.Object);
            var fileNames = await service.DownloadFileNames();

            Assert.IsTrue(fileNames.Contains("test.pdf"));
            Assert.IsTrue(fileNames.Contains("test.pdf"));
        }