|
|
|
|
|
by shireboy
1187 days ago
|
|
Yes, I have it set up where I can play the tests manually via the .http file or automated via a test suite. In general, I parse the .http file- each ### represents a new test, next line is METHOD URL, next lines are headers, empty space, then request body. Would vary based on test framework, but for mstest, it looks like this: [DataTestMethod]
[DynamicData(nameof(GetAllHttpTests), DynamicDataSourceType.Method, DynamicDataDisplayName = nameof(GetTestDisplayName))]
public async Task RunHttpTests(string endpoint, string method, string data){...} To be clear, this is integration testing, not unit. Testing that certain HTTP requests work, not necessarily that they are correct. |
|