Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scottsauber/b31c823032484f2ede7870a138c3f95a to your computer and use it in GitHub Desktop.
Save scottsauber/b31c823032484f2ede7870a138c3f95a to your computer and use it in GitHub Desktop.
Just the constructor
public class ApplicationUsersControllerGetApplicationUser
{
private readonly ApplicationDbContext _context;
private readonly HttpClient _client;
public ApplicationUsersControllerGetApplicationUser()
{
var builder = new WebHostBuilder()
.UseEnvironment("Testing")
.UseStartup<Startup>();
var server = new TestServer(builder);
_context = server.Host.Services.GetService(typeof(ApplicationDbContext)) as ApplicationDbContext;
_client = server.CreateClient();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment