Beispiel #1
0
        public async Task ThrowGetErrorTest()
        {
            await Task.Delay(10);

            Assert.ThrowsAsync <HttpRequestException>(async() =>
            {
                await JsonClient.GetString(_defaultHttp);
            });

            Assert.ThrowsAsync <HttpRequestException>(async() =>
            {
                await JsonClient.Get <BasicJson>(_defaultHttp);
            });

            Assert.ThrowsAsync <HttpRequestException>(async() =>
            {
                await JsonClient.GetBinary(_defaultHttp);
            });
        }
Beispiel #2
0
        public async Task WithValidParams_ReturnsTrue()
        {
            var headers = await JsonClient.GetBinary(new Uri($"{DefaultHttp}{Api}/WithValidParams"));

            Assert.IsTrue(headers.Any());
        }
Beispiel #3
0
 public void WithInvalidUrl_ThrowsJsonRequestException()
 {
     Assert.ThrowsAsync <JsonRequestException>(async() =>
                                               await JsonClient.GetBinary(new Uri($"{DefaultHttp}/InvalidParam")));
 }
Beispiel #4
0
 public void WithNullUrl_ThrowsArgumentNullException()
 {
     Assert.ThrowsAsync <ArgumentNullException>(async() =>
                                                await JsonClient.GetBinary(null));
 }