Exemplo n.º 1
0
        private async Task <bool> IsAttendeeValid(int attendeeId)
        {
            await HttpContext.Session.LoadAsync();

            var session = HttpContext.Session.GetInt32(_stringConstants.AttendeeIdSessionKey);

            if (session == null)
            {
                return(false);
            }

            else if (session.Value == attendeeId && await _testConductRepository.IsTestAttendeeExistByIdAsync(attendeeId))
            {
                return(true);
            }

            return(false);
        }
Exemplo n.º 2
0
        public async Task IsTestAttendeeExistByIdAsyncTest()
        {
            var testAttendee = InitializeTestAttendeeParameters();

            await CreateTestAsync();

            await _testConductRepository.RegisterTestAttendeesAsync(testAttendee);

            var attendeeId = await _trappistDbContext.TestAttendees.OrderBy(x => x.Email).Where(x => x.Email.Equals(testAttendee.Email)).Select(x => x.Id).FirstOrDefaultAsync();

            Assert.True(await _testConductRepository.IsTestAttendeeExistByIdAsync(attendeeId));
        }