Skip to content

Commit

Permalink
Assert.IsNotNull(json);
Browse files Browse the repository at this point in the history
  • Loading branch information
tqk2811 committed Jul 27, 2024
1 parent 638bb20 commit 45d7ed5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/TestProxy/BaseConnectTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public async Task HttpGet()
using HttpResponseMessage httpResponseMessage = await _httpClient.SendAsync(httpRequestMessage, HttpCompletionOption.ResponseHeadersRead);
string content = await httpResponseMessage.Content.ReadAsStringAsync();
dynamic json = JsonConvert.DeserializeObject(content);
Assert.IsNotNull(json);
Assert.AreEqual(json["url"]?.ToString(), "http://httpbin.org/get");
}

Expand All @@ -36,6 +37,7 @@ public async Task HttpGetTwoTimes()
using HttpResponseMessage httpResponseMessage = await _httpClient.SendAsync(httpRequestMessage, HttpCompletionOption.ResponseHeadersRead);
string content = await httpResponseMessage.Content.ReadAsStringAsync();
dynamic json = JsonConvert.DeserializeObject(content);
Assert.IsNotNull(json);
Assert.AreEqual(json["url"]?.ToString(), "http://httpbin.org/get");
}

Expand All @@ -58,6 +60,7 @@ public async Task HttpPost()
using HttpResponseMessage httpResponseMessage = await _httpClient.SendAsync(httpRequestMessage, HttpCompletionOption.ResponseHeadersRead);
string content = await httpResponseMessage.Content.ReadAsStringAsync();
dynamic json = JsonConvert.DeserializeObject(content);
Assert.IsNotNull(json);
Assert.AreEqual(json["url"]?.ToString(), "http://httpbin.org/post");
Assert.AreEqual(json["data"]?.ToString(), "Test post");
}
Expand All @@ -70,6 +73,7 @@ public async Task HttpsGet()
using HttpResponseMessage httpResponseMessage = await _httpClient.SendAsync(httpRequestMessage, HttpCompletionOption.ResponseHeadersRead);
string content = await httpResponseMessage.Content.ReadAsStringAsync();
dynamic json = JsonConvert.DeserializeObject(content);
Assert.IsNotNull(json);
Assert.AreEqual(json["url"]?.ToString(), "https://httpbin.org/get");
}

Expand All @@ -82,6 +86,7 @@ public async Task HttpsPost()
using HttpResponseMessage httpResponseMessage = await _httpClient.SendAsync(httpRequestMessage, HttpCompletionOption.ResponseHeadersRead);
string content = await httpResponseMessage.Content.ReadAsStringAsync();
dynamic json = JsonConvert.DeserializeObject(content);
Assert.IsNotNull(json);
Assert.AreEqual(json["url"]?.ToString(), "https://httpbin.org/post");
Assert.AreEqual(json["data"]?.ToString(), "Test post");
}
Expand Down

0 comments on commit 45d7ed5

Please sign in to comment.