Esempio n. 1
0
        public async Task PauseResumeTest()
        {
            var    test     = CreateTest("Test 1");
            string userName = "******";
            //Configuring Application User
            ApplicationUser user = new ApplicationUser()
            {
                Email = userName, UserName = userName
            };
            await _userManager.CreateAsync(user);

            var applicationUser = await _userManager.FindByEmailAsync(user.Email);

            await _testRepository.CreateTestAsync(test, applicationUser.Id);

            await _testRepository.PauseResumeTestAsync(test.Id, true);

            var testObject = _trappistDbContext.Test.FirstOrDefault(x => x.Id == test.Id);

            Assert.True(testObject.IsPaused);
        }
Esempio n. 2
0
        public async Task <IActionResult> PauseTestAsync([FromRoute] int id, [FromRoute] bool isPause)
        {
            await _testRepository.PauseResumeTestAsync(id, isPause);

            return(Ok(isPause));
        }