public void ContactCheckEditViewConformToListTest()
        {
            CheckResultSet checkResultSet = new CheckResultSet();

            app.ContactHelper.PrepareContactWithIndex(CONTACT_INDEX);

            ContactData contactInfoFromList     = app.ContactHelper.GetContactInfoFromList(CONTACT_INDEX);
            ContactData contactInfoFromEditForm = app.ContactHelper.GetContactInfoFromEditForm(CONTACT_INDEX);

            checkResultSet.Add(contactInfoFromList.Compare(contactInfoFromEditForm));

            checkResultSet.CheckTestResult();
        }
        public void ContactCheckViewFormConformsToEditTest()
        {
            CheckResultSet checkResultSet = new CheckResultSet();

            app.ContactHelper.PrepareContactWithIndex(CONTACT_INDEX);
            ContactData contactInfoFromEditForm = app.ContactHelper.GetContactInfoFromEditForm(CONTACT_INDEX);

            string contactInfoFromViewString     = PrettyPrint.CleanSpecialCharacters(app.ContactHelper.GetContactInfoFromViewForm(CONTACT_INDEX));
            string contactInfoFromEditFormString = PrettyPrint.CleanSpecialCharacters(contactInfoFromEditForm.ViewFormString);

            checkResultSet.Add(new CheckResult(contactInfoFromViewString == contactInfoFromEditFormString,
                                               $"Expected: \n${contactInfoFromEditFormString} Got: \n${contactInfoFromViewString}\n${app.Driver.Url}\n"));
            checkResultSet.CheckTestResult();
        }
Example #3
0
        protected CheckResultSet CormpareTwoModelLists <T>(List <T> listFirst, List <T> listSecond,
                                                           Func <T, T, CheckResult> compareAndGetTestResult)
        {
            CheckResultSet retval            = new CheckResultSet();
            CheckResult    compareListLength = CompareListLength(listFirst, listSecond);

            retval.Add(compareListLength);
            List <T> longestList  = listSecond.Count >= listFirst.Count ? listSecond : listFirst;
            List <T> shortestList = listSecond.Count < listFirst.Count ? listSecond : listFirst;

            for (int i = 0; i < longestList.Count; i++)
            {
                T elementToCompare = default(T);
                if (i < shortestList.Count)
                {
                    elementToCompare = shortestList[i];
                }

                CheckResult currentCheckResult = compareAndGetTestResult(longestList[i], elementToCompare);
                retval.Add(currentCheckResult);
            }
            return(retval);
        }