Example #1
0
        public void WhenISaveAnotherAsFollows(ProfileInfoType type, Table table)
        {
            var detail = CreateProfileDetail(type, table);

            // retrieve ID
            ProfilePage.MainSection.SaveProfileDetail(detail);
            _context.Set(detail);
            TestHelper.GetListOfObjectsToBeRemoved(_context).Add(detail);
            _driver.WaitForAjax();
            detail.Id = _helper.GetOrAdd((object)detail);
        }
Example #2
0
        public void GivenIAlreadyHaveAsFollows(ProfileInfoType type, Table table)
        {
            var details = CreateProfileDetails(type, table);
            //Type elementType = details.FirstOrDefault()?.GetType();
            //var genericMethod = typeof(Enumerable).GetMethod("Cast").MakeGenericMethod(elementType);
            //System.Collections.IEnumerable converted = genericMethod.Invoke(null, new[] { details }) as System.Collections.IEnumerable;
            //var credentials = TestBase.Credentials;
            //var helper = new DataSetUpHelper(credentials.Username, credentials.Password); // share helper in the same thread? not sure
            //initialise

            var objectsToBeDeleted = TestHelper.GetListOfObjectsToBeRemoved(_context);

            foreach (var detail in details)
            {
                detail.Id = _helper.GetOrAdd((object)detail);
                objectsToBeDeleted.Add(detail);
            }
        }
Example #3
0
        private SearchableItem CreateProfileDetail(ProfileInfoType type, Table table)
        {
            switch (type)
            {
            case ProfileInfoType.Language:
                return(table.CreateInstance <Language>());

            case ProfileInfoType.Skill:
                return(table.CreateInstance <Skill>());

            case ProfileInfoType.Education:
                return(table.CreateInstance <Education>());

            case ProfileInfoType.Certification:
                return(table.CreateInstance <Certification>());

            default:
                throw new ArgumentException($"Unknown {nameof(type)} specified : {type:G}");
            }
        }
        public void ClickTab(ProfileInfoType type)
        {
            switch (type)
            {
            case ProfileInfoType.Language:
                _driver.Click(LanguagesTabButton);
                return;

            case ProfileInfoType.Skill:
                _driver.Click(SkillsTabButton);
                return;

            case ProfileInfoType.Education:
                _driver.Click(EducationTabButton);
                return;

            case ProfileInfoType.Certification:
                _driver.Click(CertificationTabButton);
                return;

            default:
                throw new ArgumentException($"Illegal argument was passed '{type:G}'");
            }
        }
Example #5
0
 public void GivenIAmOnTab(ProfileInfoType type)
 {
     ProfilePage.Open();
     ProfilePage.MainSection.ClickTab(type);
 }