Quote:I will pursue these more when I get some more me-time.
Ok, looked at the unit-test error. I could not reproduce in my test solution :/
But I establisted that the issue is with the following code snippet:
Quote:
client.Setup(
c =>
c.GetXXXAsync(
It.IsAny<int>(),
It.IsAny<bool>(),
It.IsAny<bool>(),
It.IsAny<string>(),
It.IsAny<Dictionary<string, List<string>>>(),
It.IsAny<CancellationToken>()))
.Throws(
new ValidationException(
new Validation.ValidationErrors()
{
Errors =
{
new Validation.ValidationError()
{
Code = "100",
Member = "TestMe",
Reason = "Unit tests"
}
}
},
new HttpRequestMessageWrapper(new HttpRequestMessage(), null),
new HttpResponseMessageWrapper(new HttpResponseMessage(HttpStatusCode.BadRequest), null)));
where 'client' is a Moq of a AutoRest-generated swagger client (and the rest is fairly vanilla stuff). If I comment out the two HttpR*Wrapper at the end (swap with null), NCrunch will run the test. These two classes come from Microsoft.Rest.ClientRuntime, which is directly referenced by the test project.
This is reminicent of issues I had just after converting from VS2015/project.json, which was fixed by making the test project a <Project Sdk="Microsoft.NET.Sdk.Web"> instead of a <Project Sdk="Microsoft.NET.Sdk">. If I remember correctly, we had a couple of days of issues converting..