public void AddCandidateExam(User user, CandidateExam candidateExam)
 {
     AcademyLoginProvider.Instance.LoginUser(user);
     this.LoginPage.WaitForUserName();
     this.LoginPage.Validator.ValidateUserName(user.Username);
     this.CandidateExamsPage.Navigate();
     this.CandidateExamsPage.Validator.CandidateExamPageLoaded();
     this.CandidateExamsPage.AddCandidateExam(candidateExam);
 }
        public bool CandidateExamAdded(ReadOnlyCollection<HtmlTableCell> candidateExamsGridFirstRowData,
            CandidateExam candidateExam)
        {
            var isCandidateCountSame =
                candidateExamsGridFirstRowData.Any(d => d.InnerText == candidateExam.CandidatesCountLimit);
            var isStartDateSame = candidateExamsGridFirstRowData.Any(d => d.InnerText == candidateExam.StartTime);
            var isTrainingRoomSame = candidateExamsGridFirstRowData.Any(d => d.InnerText == candidateExam.TrainingRoom);

            var isCandidateExamAdded = isCandidateCountSame && isStartDateSame && isTrainingRoomSame;

            return isCandidateExamAdded;
        }
        public void AddCandidateExam(CandidateExam candidateExam)
        {
            this.Map.AddNewCandidateExam.Click();

            HtmlListItem currentListItem;

            if (candidateExam.IqTestConfiguration != null)
            {
                currentListItem = this.Map.SelectListItem(this.Map.IqTestConfigurationIdList,
                    candidateExam.IqTestConfiguration);
                currentListItem.Click();
            }

            if (candidateExam.ItTestConfiguration != null)
            {
                currentListItem = this.Map.SelectListItem(this.Map.ItTestConfigurationIdList,
                    candidateExam.ItTestConfiguration);
                currentListItem.Click();
            }

            if (candidateExam.EnglishTestConfiguration != null)
            {
                currentListItem = this.Map.SelectListItem(this.Map.EnglishTestConfigurationIdList,
                    candidateExam.EnglishTestConfiguration);
                currentListItem.Click();
            }

            this.Map.StartTime.Text = candidateExam.StartTime ?? CandidateExamConstants.DefaultStartTime;

            this.Map.EndTime.Text = candidateExam.EndTime ?? CandidateExamConstants.DefaultEndTime;

            if (candidateExam.TrainingRoom != null)
            {
                currentListItem = this.Map.SelectListItem(this.Map.TrainingRoomList, candidateExam.TrainingRoom);
                currentListItem.Click();
            }

            this.Map.AllowedIp.Text = candidateExam.AllowedIp ?? CandidateExamConstants.DefaultAllowedIp;

            this.Map.CandidatesCountLimit.Text = candidateExam.CandidatesCountLimit ??
                                                 CandidateExamConstants.DefaultCandidatesCountLimit;
        }