public void GetAllApplicationsShouldNotWork() { var options = new DbContextOptionsBuilder <development_pathways_dbContext>() .UseInMemoryDatabase(databaseName: "getallpeople_2") .Options; // Use a clean instance of the context to run the test using (var context = new development_pathways_dbContext(options)) { ApplicationBusinessLogic applicationController = new ApplicationBusinessLogic(context); IEnumerable <Application> applications = applicationController.GetAllApplications(); Assert.NotNull(applications); Assert.Empty(applications); } }
public async Task SaveApplicationShouldWorkAsync() { var options = new DbContextOptionsBuilder <development_pathways_dbContext>() .UseInMemoryDatabase(databaseName: "saveapplication_1") .Options; // Use a clean instance of the context to run the test using (var context = new development_pathways_dbContext(options)) { Application person = new Application { ApplicationId = 1, FullName = "Test Name", IdNumber = "XXXC", SubCounty = 1 }; ApplicationBusinessLogic personController = new ApplicationBusinessLogic(context); int rows = await personController.SaveApplication(person); Assert.Equal(1, rows); } }
public ApplicationBusinessLogic(development_pathways_dbContext context) { _context = context; }
public VillagesController(development_pathways_dbContext context) { _context = context; }
public CountiesController(development_pathways_dbContext context) { _context = context; }
public ApplicationsController(development_pathways_dbContext context) { _context = context; }
public TelephoneContactsController(development_pathways_dbContext context) { _context = context; }