Exemplo n.º 1
0
        public async Task Add_Valid_Test_Id()
        {
            Models.Test test = new Models.Test()
            {
                Date     = "300419",
                TestType = "Cooper Test"
            };

            Models.Test savedTest = await repository.AddAsync(test);

            await unitOfWork.Commit();

            Assert.NotNull(savedTest.Id);
            Assert.Equal(true, IsValidId(savedTest.Id));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> CreateTest([Bind("Id,Date,TestType")] Test test)
        {
            if (ModelState.IsValid)
            {
                await _TestListRpository.AddAsync(test);

                await _UnitOfWork.Commit();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(test));
        }