public void CaseActionsAllTest() { var optionBuilder = new DbContextOptionsBuilder <ApplicationDbContext>() .UseInMemoryDatabase("testDb0"); var dbContext = new ApplicationDbContext(optionBuilder.Options); var service = new CaseActionsService(dbContext); var result = service.AllAsync(); Assert.NotNull(result); }
public async Task CaseActionsDeleteTest() { var optionBuilder = new DbContextOptionsBuilder <ApplicationDbContext>() .UseInMemoryDatabase("testDb4"); var dbContext = new ApplicationDbContext(optionBuilder.Options); var service = new CaseActionsService(dbContext); var model = new CaseActionsCreateViewModel { Date = DateTime.UtcNow.Date, }; await service.CreateAsync(model); var result = service.DeleteConfirm(1); Assert.NotNull(result); }
public async Task CaseActionsEditTest() { var optionBuilder = new DbContextOptionsBuilder <ApplicationDbContext>() .UseInMemoryDatabase("testDb2"); var dbContext = new ApplicationDbContext(optionBuilder.Options); var service = new CaseActionsService(dbContext); var model = new CaseActionsCreateViewModel { Date = DateTime.UtcNow.Date, }; await service.CreateAsync(model); var edited = new CaseActionsEditViewModel { Date = DateTime.UtcNow.Date.AddDays(10), }; var result = service.EditAsync(edited); Assert.NotNull(result); }