示例#1
0
        public async Task IsAttendeeExistAsync()
        {
            var             test         = CreateTest("Aptitude");
            var             testAttendee = TestAttendee();
            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);

            testAttendee.Test   = test;
            testAttendee.TestId = test.Id;
            _trappistDbContext.TestAttendees.Add(testAttendee);
            var isExists = await _testRepository.IsTestAttendeeExistAsync(test.Id);

            Assert.True(isExists);
        }
示例#2
0
        public async Task <IActionResult> IsTestAttendeeExistAsync(int id)
        {
            var isAttendeeExist = await _testRepository.IsTestAttendeeExistAsync(id);

            return(Ok(isAttendeeExist));
        }