So, I have a very weird bug that's ending my rationality.
My problem is simple. If I write a. HttpClient.PostAsync anywhere in my test, (no matter if it's directly or via a delegate), my test does not run and just ends with the message "Inconclusive: Test not run". No error, no nothing.
Why is this happening, and how can I fix it? It was working fine a few days ago...
[Test]
public async Task TestAadfdsfsdsxc()
{
HttpClient Client = new HttpClient();
Client.DefaultRequestHeaders.Add("X-API-Key", $"{apiKey}");
Client.DefaultRequestHeaders.Add("accept", "text/plain");
Client.BaseAddress = new Uri($"{url}/api/");
var buffer = Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(payload));
var byteContent = new ByteArrayContent(buffer);
byteContent.Headers.ContentType = new MediaTypeHeaderValue("application/json");
var postResponse = await Client.PostAsync(Client.BaseAddress+$"{PayloadEndpoint}", byteContent);
}
Get requests work fine. Also worth nothing that if the PostAsync is there, no other tests run either. They all end as Inconclusive, not run. Commenting out the line works.
Using "Microsoft Visual Studio Professional 2017 - Version 15.9.7" No compilation errors. Also using ReSharper 2018.3.3.
I will reiterate that everything worked fine till a few days ago.