Beispiel #1
0
        public static List <HoldingStats> GenerateNephilaStatsTable(List <IWebElement> statsTable)
        {
            var counter           = 0;
            var holdingstatsCount = 1;
            var hs = new HoldingStats();

            ;

            var nst = new List <HoldingStats>();

            foreach (var st in statsTable)
            {
                if (counter > 0 && counter != 10)
                {
                    // Name
                    switch (holdingstatsCount)
                    {
                    case 1:
                        hs.Name = st.Text.Trim();
                        break;

                    case 2:
                        hs.Currency = st.Text.Trim();
                        break;

                    case 3:
                        hs.Percentage = st.Text.Trim();
                        break;
                    }


                    if (holdingstatsCount == 3)
                    {
                        nst.Add(hs);
                        holdingstatsCount = 1;
                        hs = new HoldingStats();
                    }
                    else
                    {
                        holdingstatsCount++;
                    }
                }

                counter++;
            }
            return(NephilaStatisticsTable = nst);
        }
        public static List<HoldingStats> GenerateNephilaStatsTable(List<IWebElement> statsTable)
        {
            var counter = 0;
            var holdingstatsCount = 1;
            var hs = new HoldingStats();
            ;

            var nst = new List<HoldingStats>();
            foreach (var st in statsTable)
            {
                if (counter > 0 && counter != 10)
                {
                    // Name
                    switch (holdingstatsCount)
                    {
                        case 1:
                            hs.Name = st.Text.Trim();
                            break;
                        case 2:
                            hs.Currency = st.Text.Trim();
                            break;
                        case 3:
                            hs.Percentage = st.Text.Trim();
                            break;
                    }


                    if (holdingstatsCount == 3)
                    {
                        nst.Add(hs);
                        holdingstatsCount = 1;
                        hs = new HoldingStats();
                    }
                    else
                    {
                        holdingstatsCount++;
                    }
                }

                counter++;
            }
            return NephilaStatisticsTable = nst;
        }