Open davidjsteele opened 4 years ago
I'm getting the same issue with integration tests on 4.0.56-beta.4.
@davidjsteele did you ever find a solution for this? I'm still struggling to get integration tests to run with ExecuteHttpAsync
@mmeckes if memory serves this was actually down to a problem with discovery of app.config files as part of ioc resolution. If you can provide more info might be able to help
@davidjsteele any help appreciated. I know it's been a while since you raised this issue. My tests were working fine but something happened when I upgraded to 4.0.56-beta.4. I also updated a bunch of other packages so it could be something else, so I'm spending some time trying to track it down.
<PackageReference Include="FunctionMonkey.Testing" Version="4.0.56-beta.4" />
<PackageReference Include="JetBrains.DotMemoryUnit" Version="3.1.20200127.214830" />
<PackageReference Include="Microsoft.AspNetCore" Version="2.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
<PackageReference Include="NSubstitute" Version="4.2.1" />
<PackageReference Include="Xbehave" Version="2.4.1" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1">
As soon as I call ExecuteHttpAsync I the error below where the provider is not getting injected in correctly. It does feel like there is some config that is off that is stopping it from resolving the dependencies correctly, but I'm struggling to track it down.
System.ArgumentNullException : Value cannot be null. (Parameter 'provider')
at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider)
at Microsoft.AspNetCore.Mvc.StatusCodeResult.ExecuteResult(ActionContext context)
at Microsoft.AspNetCore.Mvc.ActionResult.ExecuteResultAsync(ActionContext context)
at FunctionMonkey.Testing.Implementation.AspNetRuntime.CreateHttpResponse(ActionContext actionContext, IActionResult actionResult)
at FunctionMonkey.Testing.AcceptanceTestScaffold.ExecuteHttpAsync[TResult](ICommand`1 command, HttpMethod method)
at MakeItDonate.Tests.Acceptance.AddCharityShould.<>c__DisplayClass2_0.<<ReceiveBadRequestOnInvalidCharity>b__1>d.MoveNext() in C:\Users\mattm\source\repos\MakeItDonate\MakeItDonate.Tests\Acceptance\AddCharityShould.cs:line 67
--- End of stack trace from previous location where exception was thrown ---
at Xbehave.Execution.Invoker.<>c__DisplayClass0_1.<<Invoke>b__1>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
Hi,
Having trouble running my integration tests after upgrading to latest version of FM and Azure SDK running on .net Core 3.1.
App runs fine, just the tests that are broken.
Any insight would be much appreciated. Thanks