public void ThenFirstTileIsSelectedAndSelectingEachTileDisplaysClaimClassDetail()
        {
            //Reload page so carousel position resets - possible because claims is the tab loaded by default
            claimsTab.Reload();

            //Get count of claims by class
            Dictionary <string, string> parameters = new Dictionary <string, string>();

            parameters.Add("CaseId", Convert.ToString(CaseDetailSteps.GetCaseIdFromCaseNumber(ScenarioContext.Current.Get <string>("Case Number"))));
            DataRowCollection expectedClaimsCounts = ExecuteQueryOnDB(Properties.Resources.GetClaimsCountByClassByCaseId, parameters);

            int[] expClaimsCount = new int[6];
            int   i = 1;

            foreach (DataRow item in expectedClaimsCounts)
            {
                expClaimsCount[i]  = item.Field <int>("ClaimsCount");
                expClaimsCount[0] += expClaimsCount[i];
                i++;
            }

            DataRow expDataForFirstCard = null;
            //Get original set of parameters
            DataRowCollection expected = ScenarioContext.Current.Get <DataRowCollection>("Parameters Table");
            int position = 1;

            //Verify that all cards selection results in details displaying bellow
            foreach (DataRow expCard in expected)
            {
                if (position == 1)
                {
                    //Save data for last verification on first card
                    expDataForFirstCard = expCard;

                    //First card should be selected by default
                    claimsTab.IsSummaryTileSelectedByPosition(1).Should().BeTrue("Selected styles applied to selected tile");
                }
                else
                {
                    //For other cards select and then verify
                    claimsTab.SelectSummaryTileByPosition(position);
                    claimsTab.IsSummaryTileSelectedByPosition(position).Should().BeTrue("Selected styles applied to selected tile");
                }

                this.verifyClaimDetails(expCard, expClaimsCount[position - 1]);
                position++;
            }


            //Verify going back to 1st card shows details correctly
            claimsTab.Reload();
            claimsTab.SelectSummaryTileByPosition(1);
            claimsTab.IsSummaryTileSelectedByPosition(1).Should().BeTrue("Card styles applied to selected card");
            this.verifyClaimDetails(expected[0], expClaimsCount[0]);
        }
        public void ThenISeeClaimsSummaryTilesAndAllValuesAreCorrect()
        {
            //Get summary data from DB to verify is correctlyl displayed on the UI
            Dictionary <string, string> parameters = new Dictionary <string, string>();

            parameters.Add("CaseId", Convert.ToString(CaseDetailSteps.GetCaseIdFromCaseNumber(ScenarioContext.Current.Get <string>("Case Number"))));
            parameters.Add("OfficeId", Convert.ToString(CommonDBSteps.GetConfigOfficeId()));
            DataRowCollection expectedCardDetail = ExecuteQueryOnDB(Properties.Resources.GetClaimsSummaryByCaseRetrieve, parameters);

            ScenarioContext.Current.Add("Parameters Table", expectedCardDetail);

            claimsTab.IsFirstSummaryCardSelected().Should().BeTrue("All Claims Summary Card is selected by Default");

            List <ClaimSummaryItemData> summaryCards = claimsTab.GetClaimSummaryItems();

            IEnumerator enumExpectedCardDetail = expectedCardDetail.GetEnumerator();

            enumExpectedCardDetail.MoveNext();

            //check each item in given order, positions should match
            for (int i = 0; i < expectedCardDetail.Count; i++)
            {
                //expected values in this position
                DataRow row          = (DataRow)enumExpectedCardDetail.Current;
                string  expCardTitle = row.Field <string>("ClassType");
                string  expBalance   = row.Field <string>("Balance");
                string  expClaimed   = row.Field <string>("Claimed");
                string  expPaid      = row.Field <string>("Paid");
                string  expReserved  = row.Field <string>("Reserved");

                //actual values in this position
                ClaimSummaryItemData item = summaryCards[i];

                //Verifications

                //Title
                item.Title.Should().Be(expCardTitle, "Card Title is correct for Summary Item " + expCardTitle);

                //Balance
                item.BalanceLabel.Should().Be("BALANCE", expCardTitle + " Card: Balance label is correct");
                item.Balance.Should().Be(expBalance, expCardTitle + " Card: Balance value is correct");
                if (expBalance.StartsWith("-"))
                {
                    item.BalanceTextColor.Should().Be("RED");
                }

                //Claimed
                item.ClaimedLabel.Should().Be("CLAIMED", expCardTitle + " Card: Claimed label is correct");
                item.Claimed.Should().Be(expClaimed, expCardTitle + " Card: Claimed value is correct");
                if (expClaimed.StartsWith("-"))
                {
                    item.ClaimedTextColor.Should().Be("RED");
                }

                //Paid
                item.PaidLabel.Should().Be("PAID", expCardTitle + " Card: Paid label is correct");
                item.Paid.Should().Be(expPaid, expCardTitle + " Card: Paid value is correct");
                if (expPaid.StartsWith("-"))
                {
                    item.PaidTextColor.Should().Be("RED");
                }

                //Reserved
                item.ReservedLabel.Should().Be("RESERVED", expCardTitle + " Card: Reserved label is correct");
                item.Reserved.Should().Be(expReserved, expCardTitle + " Card: Reserved value is correct");
                if (expReserved.StartsWith("-"))
                {
                    item.ReservedTextColor.Should().Be("RED");
                }

                //move enumerator from db data
                enumExpectedCardDetail.MoveNext();
            }
        }