Ejemplo n.º 1
0
        public async Task UniqueNameTest()
        {
            var             test     = CreateTest("testname");
            string          userName = "******";
            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);

            var  name    = "nameOfTest";
            var  id      = 0;
            bool isExist = await _testRepository.IsTestNameUniqueAsync(name, id);

            Assert.True(isExist);
        }
Ejemplo n.º 2
0
 public async Task <bool> IsTestNameUnique([FromRoute] string testName, [FromRoute] int id)
 {
     // verifying the test name is unique or not
     return(await _testRepository.IsTestNameUniqueAsync(testName, id));
 }