コード例 #1
0
        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);
            }
        }
コード例 #2
0
        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);
            }
        }
コード例 #3
0
 public ApplicationBusinessLogic(development_pathways_dbContext context)
 {
     _context = context;
 }
コード例 #4
0
 public VillagesController(development_pathways_dbContext context)
 {
     _context = context;
 }
コード例 #5
0
 public CountiesController(development_pathways_dbContext context)
 {
     _context = context;
 }
コード例 #6
0
 public ApplicationsController(development_pathways_dbContext context)
 {
     _context = context;
 }
コード例 #7
0
 public TelephoneContactsController(development_pathways_dbContext context)
 {
     _context = context;
 }