I am trying to create integration tests for my ASP5 MVC6 application.
In my integration tests, I registered all my classes and added some special MVC Startup class form:
_services.AddEntityFramework() .AddSqlServer() .AddDbContext<ApplicationDbContext>( options => options.UseSqlServer(_configuration[ServerModulesLoader.DataDefaultConnectionConnectionstringConfigurationKey])); _services.AddIdentity<ApplicationUser, IdentityRole>() .AddEntityFrameworkStores<ApplicationDbContext>() .AddDefaultTokenProviders(); _services.AddCors(); _services.AddMvc();
Everything works fine until IUrlHelper or IHttpContextAccessor appears in the dependency tree.
This is how I create my test controllers:
Right now I have registered mocks for these interfaces, but I would prefer to use the original implementations.
What am I missing?
source share