Beispiel #1
0
        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);
        }
Beispiel #2
0
        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);
        }
Beispiel #3
0
        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);
        }