You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently this command expects an IHostBuilder to be passed in for it to build a webhost. However, in integration tests, we typically spin up a webapp via WebApplicationFactory (fixture) to verify the codegen the devs committed in the repo is current and correct.
We do the following currently.
privatevoidGenerateCode(IServiceProviderservices)=>newDynamicCodeBuilder(services,services.GetServices<ICodeFileCollection>().ToArray()){ServiceVariableSource=services.GetService<IServiceVariableSource>()}.WriteGeneratedCode(file =>{_fixture.TestOutputHelper?.WriteLine("Wrote generated code file to "+file);});
However, this is reaching into undocumented (read: no official doc means potentially unsupported) territory. Would be nice if there's an extension method in a nuget package for this method (and other useful ones in the oakton package) that doesn't require us to use undocumented interfaces.
The text was updated successfully, but these errors were encountered:
Currently this command expects an
IHostBuilder
to be passed in for it to build a webhost. However, in integration tests, we typically spin up a webapp viaWebApplicationFactory
(fixture) to verify the codegen the devs committed in the repo is current and correct.We do the following currently.
However, this is reaching into undocumented (read: no official doc means potentially unsupported) territory. Would be nice if there's an extension method in a nuget package for this method (and other useful ones in the oakton package) that doesn't require us to use undocumented interfaces.
The text was updated successfully, but these errors were encountered: