Beispiel #1
0
        public void ThenISeeDistributionSummaryCardsAndAllValuesAreCorrect(Table table)
        {
            ScenarioContext.Current.Add("Parameters Table", table);

            TableRows expected = table.Rows;
            List <DistributionSummaryItemData> summaryCards = distributionTab.GetSummaryItems();

            //check each item in given order, positions should match
            for (int i = 0; i < expected.Count; i++)
            {
                //expected values in this position
                TableRow row = expected[i];
                string   expDistributionName  = row["Distribution Name"];
                string   expStatus            = row["Status"];
                string   expModifiedPayment   = row["Modified Payment"];
                string   expCalculatedPayment = row["Calculated Payment"];
                string   expDifference        = row["Difference"];
                string   expUpdatedDate       = row["Updated Date"];

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

                //verifications
                item.DistributionName.Should().Be(expDistributionName, expDistributionName + " Card: Distribution Name is correct");
                item.Status.Should().Be(expStatus, expDistributionName + " Card: Status is correct");

                if (item.Status == "EDITABLE")
                {
                    item.CardUIStyle.Should().Be("BlueHeader", "Editable Distributions have Blue header");
                }
                else
                {
                    item.CardUIStyle.Should().Be("GreyHeader", "Posted Distributions have Grey header");
                }

                item.ModifiedPaymentLabel.Should().Be("Modified Payment", expDistributionName + "Card: Modified Payment Label is correct");
                item.ModifiedPayment.Should().Be(expModifiedPayment, expDistributionName + "Card: Modified Payment Value is correct");

                item.CalculatedPaymentLabel.Should().Be("Calculated Payment", expDistributionName + "Card: Calculated Payment Label is correct");
                item.CalculatedPayment.Should().Be(expCalculatedPayment, expDistributionName + "Card: Calculated Payment Value is correct");

                item.DifferenceLabel.Should().Be("Difference", expDistributionName + "Card: Difference Label is correct");
                item.Difference.Should().Be(expDifference, expDistributionName + "Card: Difference Value is correct");

                item.UpdatedDateLabel.Should().Be("Updated Date", expDistributionName + "Card: Updated Date Label is correct");
                item.UpdatedDate.Should().Be(expUpdatedDate, expDistributionName + "Card: Updated Date Value is correct");
            }
        }