Пример #1
0
        public static HtmlNode GetCorrectScoreMarketNodeWithoutMarketName()
        {
            string html = @"
                <div>
                    <div>
                        <div class='marketTable__header___mSHxT' title='Correct map score'>Test Name</div>
                    </div>
                    <div class='scoreMarketRow__container___1n55P_correct_score_with_values'>
                        <div class='scoreMarketRow__column___2OuUC'>
                            <div class='scoreMarketRow__odd-wrapper___3g5qT'>
                                <div class='__app-Odd-title odd__title___1kZ6V' title='2:1'>2:1</div>
                                    <button class='__app-Odd-button odd__button___2eiZg'>
                                        <div class='__app-Odd-inner odd__inner___3F_cm'>
                                            <div class='odd__ellipsis___3b4Yk'>2.25</div>
                                        </div>
                                    </button>
                                </div>
                            </div>
                        </div>
                        <div class='scoreMarketRow__column___2OuUC'>
                            <div class='scoreMarketRow__odd-wrapper___3g5qT'>
                                <div class='__app-Odd-title odd__title___1kZ6V' title='1:2'>1:2</div>
                                    <button class='__app-Odd-button odd__button___2eiZg'>
                                        <div class='__app-Odd-inner odd__inner___3F_cm'>
                                            <div class='odd__ellipsis___3b4Yk'>1.6</div>
                                        </div>
                                    </button>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>";

            return(HtmlNodesLoader.Load(html));
        }
Пример #2
0
        public static HtmlNode GetHandicapMarketNodeWithSuspendedOdd()
        {
            string html = @"
                <div>
                    <div>
                        <div>
                            <div class='marketTable__header___mSHxT' title='Map handicap'>Map handicap</div>
                        </div>
                        <div class='tableMarketRow__container___3jeni_handicap_with_values'>
                            <div class='tableMarketRow__column___2kCi8'>
                                <div class='marketRowOddTable__container___TfWHU'>
                                    <div class='marketRowOddTable__title-wrapper___1JryI' title='-1.5'>
                                        <span>-1.5</span>
                                    </div>
                                    <div class='marketRowOddTable__odd-wrapper___lWDBZ'>
                                        <div title='Deactivated' class='__app-Odd-is-disabled odd__is-disabled___bCpHE'></div>
                                    </div>
                                </div>
                            </div>
                            <div class='tableMarketRow__column___2kCi8'>
                                <div class='marketRowOddTable__container___TfWHU'>
                                    <div class='marketRowOddTable__title-wrapper___1JryI' title='-1.5'>
                                        <span>-1.5</span>
                                    </div>
                                    <div class='marketRowOddTable__odd-wrapper___lWDBZ'>
                                        <button class='__app-Odd-button odd__button___2eiZg'>1.18</button>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>";

            return(HtmlNodesLoader.Load(html));
        }
Пример #3
0
        public static HtmlNode GetHandicapMarketNodeWithoutValues()
        {
            string html = @"
                <div>
                    <div>
                        <div>
                            <div class='marketTable__header___mSHxT' title='Map handicap'>Map handicap</div>
                        </div>
                        <div class='tableMarketRow__container___3jeni_handicap_with_values'>
                            <div class='tableMarketRow__column___2kCi8'>
                                <div class='marketRowOddTable__container___TfWHU'>
                                    <div class='marketRowOddTable__title-wrapper___1JryI' title='-1.5'>
                                        <span>-1.5</span>
                                    </div>
                                </div>
                            </div>
                            <div class='tableMarketRow__column___2kCi8'>
                                <div class='marketRowOddTable__container___TfWHU'>
                                    <div class='marketRowOddTable__title-wrapper___1JryI' title='1.5'>
                                        <span>1.5</span>
                                    </div>
                                </div>
                            </div>
                        </div>                       
                    </div>
                </div>";

            return(HtmlNodesLoader.Load(html));
        }
Пример #4
0
        public static HtmlNode GetHandicapMarketNodeWithMissingMarketName()
        {
            string html = @"
                <div>
                    <div>
                        <div>
                            <div class='marketTable__header___mSHxT' title='Map handicap'>Test Name</div>
                        </div>
                        <div class='tableMarketRow__container___3jeni_handicap_with_values'>
                            <div class='tableMarketRow__column___2kCi8'>
                                <div class='marketRowOddTable__container___TfWHU'>
                                    <div class='marketRowOddTable__title-wrapper___1JryI' title='-1.5'>
                                        <span>-1.5</span>
                                    </div>
                                    <div class='marketRowOddTable__odd-wrapper___lWDBZ'>
                                        <button class='__app-Odd-button odd__button___2eiZg'>5.18</button>
                                    </div>
                                </div>
                            </div>
                            <div class='tableMarketRow__column___2kCi8'>
                                <div class='marketRowOddTable__container___TfWHU'>
                                    <div class='marketRowOddTable__title-wrapper___1JryI' title='1.5'>
                                        <span>1.5</span>
                                    </div>
                                    <div class='marketRowOddTable__odd-wrapper___lWDBZ'>
                                        <button class='__app-Odd-button odd__button___2eiZg'>1.18</button>
                                    </div>
                                </div>
                            </div>
                        </div>                       
                    </div>
                </div>";

            return(HtmlNodesLoader.Load(html));
        }
Пример #5
0
        public static HtmlNode GetCorrectScoreMarketNodeWithoutValues()
        {
            string html = @"
                <div>
                    <div>
                        <div class='marketTable__header___mSHxT' title='Correct map score'>Correct map score</div>
                    </div>
                    <div class='scoreMarketRow__container___1n55P_correct_score_with_values'>
                        <div class='scoreMarketRow__column___2OuUC'>
                            <div class='scoreMarketRow__odd-wrapper___3g5qT'>
                                <div class='__app-Odd-title odd__title___1kZ6V' title='2:1'>2:1</div>
                                </div>
                            </div>
                        </div>
                        <div class='scoreMarketRow__column___2OuUC'>
                            <div class='scoreMarketRow__odd-wrapper___3g5qT'>
                                <div class='__app-Odd-title odd__title___1kZ6V' title='1:2'>1:2</div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>";

            return(HtmlNodesLoader.Load(html));
        }
Пример #6
0
        public void GetTwoWayOdddsCountShouldReturnZeroCountWhenMarketNodeIsInvalid()
        {
            HtmlNode marketNode = HtmlNodesLoader.Load("<div></div>");
            int      count      = htmlService.GetTwoWayOddsCount(marketNode);

            Assert.AreEqual(0, count);
        }
Пример #7
0
        public void GetTwoWayOdddsCountShouldReturnOneCountWhenMarketNodeHasOneChildNode()
        {
            HtmlNode marketNode = HtmlNodesLoader.Load("<div><div class='tableMarketRow__container___3jeni'><div class='tableMarketRow__odd-wrapper___3nnKr'></div<</div></div>");
            int      count      = htmlService.GetTwoWayOddsCount(marketNode);

            Assert.AreEqual(1, count);
        }
Пример #8
0
        public static HtmlNode GetCorrectScoreMarketNodeWithOneSuspendedOdd()
        {
            string html = @"
                <div>
                    <div>
                        <div class='marketTable__header___mSHxT' title='Correct map score'>Correct map score</div>
                    </div>
                    <div class='scoreMarketRow__container___1n55P_correct_score_with_values'>
                        <div class='scoreMarketRow__column___2OuUC'>
                            <div class='scoreMarketRow__odd-wrapper___3g5qT'>
                                <div class='__app-Odd-title odd__title___1kZ6V' title='2:1'>2:1</div>
                                    <div class='tableMarketRow__odd-wrapper___3nnKr'>
                                        <div title='Deactivated' class='__app-Odd-is-disabled odd__is-disabled___bCpHE'></div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class='scoreMarketRow__column___2OuUC'>
                            <div class='scoreMarketRow__odd-wrapper___3g5qT'>
                                <div class='__app-Odd-title odd__title___1kZ6V' title='1:2'>1:2</div>
                                    <button class='__app-Odd-button odd__button___2eiZg'>
                                        <div class='__app-Odd-inner odd__inner___3F_cm'>
                                            <div class='odd__ellipsis___3b4Yk'>1.6</div>
                                        </div>
                                    </button>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>";

            return(HtmlNodesLoader.Load(html));
        }
Пример #9
0
        public void GetTwoWayOdddsCountShouldReturnZeroCountWhenMarketNodeDoesNotHaveChildNodes()
        {
            HtmlNode marketNode = HtmlNodesLoader.Load("<div><div class='tableMarketRow__container___3jeni'></div></div>");
            int      count      = htmlService.GetTwoWayOddsCount(marketNode);

            Assert.AreEqual(0, count);
        }
Пример #10
0
        public static HtmlNode GetCorrectScoreMarketNodeWithOneResultedOdd()
        {
            string html = @"
                <div>
                    <div>
                        <div class='marketTable__header___mSHxT' title='Correct map score'>Correct map score</div>
                    </div>
                    <div class='scoreMarketRow__container___1n55P'>
                        <div class='scoreMarketRow__column___2OuUC'>
                            <div class='scoreMarketRow__odd-wrapper___3g5qT'>
                                <div class='__app-Odd-title odd__title___1kZ6V' title='2:1'>2:1</div>
                                    <div class='tableMarketRow__odd-wrapper___3nnKr'>
                                        <div class='odd__result___1K5vV'>Win</div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class='scoreMarketRow__column___2OuUC'>
                            <div class='scoreMarketRow__odd-wrapper___3g5qT'>
                                <div class='__app-Odd-title odd__title___1kZ6V' title='1:2'>1:2</div>
                                    <div class='tableMarketRow__odd-wrapper___3nnKr'>
                                        <div class='odd__result___1K5vV'>Loss</div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>";

            return(HtmlNodesLoader.Load(html));
        }
Пример #11
0
        public void IsSuspendedShouldReturnFalseWhenOddNodeIsInvalid()
        {
            HtmlNode oddNode = HtmlNodesLoader.Load("<div></div>");

            bool isSuspended = htmlService.IsSuspended(oddNode);

            Assert.IsFalse(isSuspended);
        }
Пример #12
0
        public void HasHeaderShouldReturnTrueWhenMarketNodeHasValidClass()
        {
            HtmlNode marketNode = HtmlNodesLoader.Load("<div><div class='tableMarketRow__specifier-value___3S715'></div></div>");

            bool hasHeader = htmlService.HasHeader(marketNode);

            Assert.IsTrue(hasHeader);
        }
Пример #13
0
        public void HasHeaderShouldReturnFalseWhenMarketNodeIsInvalid()
        {
            HtmlNode marketNode = HtmlNodesLoader.Load("<div></div>");

            bool hasHeader = htmlService.HasHeader(marketNode);

            Assert.IsFalse(hasHeader);
        }
Пример #14
0
        public void GetOddResultStatusShouldReturnWinWhenOddNodeContainsInnerTextWinInLowerCase()
        {
            HtmlNode oddNode = HtmlNodesLoader.Load("<div><div class='odd__result___1K5vV'>win</div></div>");

            OddResultFeedStatus status = htmlService.GetOddResultStatus(oddNode);

            Assert.AreEqual(OddResultFeedStatus.Win, status);
        }
Пример #15
0
        public void GetOddResultStatusShouldReturnNotResultedWhenOddNodeDoesNotContainInnerText()
        {
            HtmlNode oddNode = HtmlNodesLoader.Load("<div><div class='odd__result___1K5vV'></div></div>");

            OddResultFeedStatus status = htmlService.GetOddResultStatus(oddNode);

            Assert.AreEqual(OddResultFeedStatus.NotResulted, status);
        }
Пример #16
0
        public void IsSuspendedShouldReturnTrueWhenOddNodeContainsValidTitleAndClass()
        {
            HtmlNode oddNode = HtmlNodesLoader.Load("<div title='Deactivated' class='__app-Odd-is-disabled'></div>");

            bool isSuspended = htmlService.IsSuspended(oddNode);

            Assert.IsTrue(isSuspended);
        }
Пример #17
0
        public void GetOddNamesShouldReturnNullWhenMarketNodeDOesNotHaveParentNode()
        {
            HtmlNode marketNode = HtmlNodesLoader.Load("<div class='tableColumnNames__column___-zFNK'></div>");

            IEnumerable <string> oddNames = htmlService.GetOddNames(marketNode);

            Assert.IsTrue(oddNames == null);
        }
        public void GetShouldReturnTournamentWithNameWhenMatchInfoContainsInnerText()
        {
            HtmlNode matchInfo = HtmlNodesLoader.Load("<div><div class='__app-PromoMatchBody-tournament promoMatchBody__tournament___1M0Aj'>TournamentName</div></div>");

            TournamentFeedModel tournament = tournamentsProvider.Get(matchInfo);

            Assert.IsFalse(string.IsNullOrEmpty(tournament.Name));
        }
        public void GetShouldReturnTournamentWithoutNameWhenMatchInfoIsInvalid()
        {
            HtmlNode matchInfo = HtmlNodesLoader.Load("<div></div>");

            TournamentFeedModel tournament = tournamentsProvider.Get(matchInfo);

            Assert.IsTrue(string.IsNullOrEmpty(tournament.Name));
        }
Пример #20
0
        public void GetShouldReturnNullWhenMatchContainerIsInvalid()
        {
            HtmlNode matchContainer = HtmlNodesLoader.Load("<div></div>");

            IEnumerable <TeamFeedModel> teams = teamsProvider.Get(matchContainer);

            Assert.AreEqual(null, teams);
        }
Пример #21
0
        public void IsSuspendedShouldReturnFalseWhenOddNodeContainsValidTitleButDoesNotContainValidClass()
        {
            HtmlNode oddNode = HtmlNodesLoader.Load("<div title='Deactivated'></div>");

            bool isSuspended = htmlService.IsSuspended(oddNode);

            Assert.IsFalse(isSuspended);
        }
Пример #22
0
        public void GetOddNamesShouldReturnOneOddNameWhenMarketNodeHasParentNodeAndValidClass()
        {
            HtmlNode marketNode = HtmlNodesLoader.Load("<div><div class='tableColumnNames__column___-zFNK'></div></div>");

            IList <string> oddNames = htmlService.GetOddNames(marketNode);

            Assert.AreEqual(1, oddNames.Count);
        }
Пример #23
0
        public void IsSuspendedShouldReturnFalseWhenOddNodeDoesNotContainValidTitleButContainsValidClass()
        {
            HtmlNode oddNode = HtmlNodesLoader.Load("<div title='InvalidTitle' class='__app-Odd-is-disabled'></div>");

            bool isSuspended = htmlService.IsSuspended(oddNode);

            Assert.IsFalse(isSuspended);
        }
Пример #24
0
        public void GetOddResultStatusShouldReturnNotResultedWhenOddNodeIsInvalid()
        {
            HtmlNode oddNode = HtmlNodesLoader.Load("<div></div>");

            OddResultFeedStatus status = htmlService.GetOddResultStatus(oddNode);

            Assert.AreEqual(OddResultFeedStatus.NotResulted, status);
        }
Пример #25
0
        public void GetOddNamesShouldReturnNullWhenMarketNodeHasInvalidClass()
        {
            HtmlNode marketNode = HtmlNodesLoader.Load("<div></div>");

            IEnumerable <string> oddNames = htmlService.GetOddNames(marketNode);

            Assert.IsTrue(oddNames == null);
        }
Пример #26
0
        public static HtmlNode GetInvalidMatchContainerWithOnlyOneTeam()
        {
            string html = @"
                <div>
                    <div class='__app-PromoMatchBody-competitor-name promoMatchBody__competitor-name___3IM6A'>Antrophy</div>
                </div>";

            return(HtmlNodesLoader.Load(html));
        }
Пример #27
0
        public static HtmlNode GetValidMatchContainerWithTeamsWithoutScores()
        {
            string html = @"
                <div>
                    <div class='__app-PromoMatchBody-competitor-name promoMatchBody__competitor-name___3IM6A'>Antrophy</div>
                    <div class='__app-PromoMatchBody-competitor-name promoMatchBody__competitor-name___3IM6A'>The Prime</div>
                </div>";

            return(HtmlNodesLoader.Load(html));
        }
Пример #28
0
        public static HtmlNode GetMarketNodeWithOneOdd()
        {
            string html = @"
                <div>
                    <div>
                        <div class='tableMarketRow__container___3jeni_one_odd'>
                            <div class='tableMarketRow__odd-wrapper___3nnKr'></div>
                        </div>
                    </div>
                </div>";

            return(HtmlNodesLoader.Load(html));
        }
Пример #29
0
        public static HtmlNode GetTwoWayMarketOddWithoutValues()
        {
            string html = @"
                <div>
                    <div>
                        <div class='tableMarketRow__container___3jeni_two_odds'>
                            <div class='tableMarketRow__odd-wrapper___3nnKr'></div>
                            <div class='tableMarketRow__odd-wrapper___3nnKr'></div>
                        </div>
                    </div>
                </div>";

            return(HtmlNodesLoader.Load(html));
        }
Пример #30
0
        public static HtmlNode GetTwoWayMarketNodeWithHeaders()
        {
            string html = @"
                <div>
                    <div>
                        <div class='tableMarketRow__container___3jeni_two_odds'>
                            <div title='1' class='tableMarketRow__specifier-value___3S715'>1</div>
                            <div class='tableMarketRow__odd-wrapper___3nnKr'></div>
                            <div title='2' class='tableMarketRow__specifier-value___3S715'>2</div>
                            <div class='tableMarketRow__odd-wrapper___3nnKr'></div>
                        </div>
                    </div>
                </div>";

            return(HtmlNodesLoader.Load(html));
        }