Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Net.Http;
- using Xunit;
- namespace API_Test
- {
- public class APITest
- {
- [Fact]
- public async void GetRequestTest()
- {
- // Create a new instance of HttpClient
- using (var client = new HttpClient())
- {
- // Make the GET request to the API endpoint
- var response = await client.GetAsync("https://api.example.com/data");
- // Assert that the response was successful (200 OK)
- Assert.True(response.IsSuccessStatusCode);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement