public void TestEnrollDeleteReturnsView() { using (_context = new MutantDbContext(options)) { _context.MutantTable.Add(mutant); _context.SaveChanges(); // Arrange EnrollController controller = new EnrollController(_context); // Act var result = controller.Delete(0); // Assert Assert.NotNull(result); } }
public void TestHomeIndexReturnsView() { using (_context = new MutantDbContext(options)) { _context.MutantTable.Add(mutant); _context.SaveChanges(); // Arrange HomeController controller = new HomeController(_context); // Act var result = controller.Index(); // Assert Assert.NotNull(result); } }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, MutantDbContext mutantDbContext) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } else { app.UseHsts(); } app.UseHttpsRedirection(); mutantDbContext.Database.EnsureCreated(); app.UseMvc(); }
public MutantController(MutantDbContext mutantDbContext) { _mutantDbContext = mutantDbContext; }
public EnrollController(MutantDbContext context) { _context = context; }
public HomeController(MutantDbContext context) { _context = context; }