Пример #1
0
        public void Dashboard_Setting_DefaultTurnedOnFunds()
        {
            TestBaseWebDriver test    = base.TestContainer[Gallio.Framework.TestContext.CurrentContext.Test.Name];
            GeneralMethods    utility = test.GeneralMethods;

            try
            {
                int churchId = test.SQL.FetchChurchID(test.Dashboard.ChurchCode);
                test.SQL.Dashboard_ClearData(churchId, test.Dashboard.DashboardUsername);

                test.Dashboard.LoginWebDriver();
                new DashboardHomePage(test.Driver, test.GeneralMethods).openSettingsPage();
                DashboardSettingsPage settings = new DashboardSettingsPage(test.Driver, test.GeneralMethods, test.SQL);

                ArrayList turnOnFundsSql    = test.SQL.Dashboard_Giving_GetDefaultTurnedOnFundsName(churchId, -5);
                ArrayList turnOnFundsOnPage = settings.getWidgetTurnedOnSubItemsOnPage(1);

                TestLog.WriteLine(turnOnFundsOnPage.Count);
                Assert.AreEqual(turnOnFundsSql.Count, turnOnFundsOnPage.Count);

                foreach (var itemOnPage in turnOnFundsOnPage)
                {
                    bool flag = false;
                    TestLog.WriteLine(itemOnPage.ToString());
                    foreach (var itemInSql in turnOnFundsSql)
                    {
                        if (itemInSql.ToString().Replace(" ", "").Contains(itemOnPage.ToString().Replace(" ", "")))
                        {
                            flag = true;
                            TestLog.WriteLine(itemInSql.ToString() + "|" + itemOnPage.ToString());
                        }
                    }
                    Assert.IsTrue(flag);
                }
            }
            finally
            {
                //clear test data
            }
        }