Exemplo n.º 1
0
        public void WithButtons_should_return_CardActionSetAssertions()
        {
            var buttons  = CardActionTestData.CreateRandomCardActions();
            var heroCard = new HeroCard(buttons: buttons);

            var sut = new HeroCardAssertions(heroCard);

            sut.WithButtons().Should().BeAssignableTo <CardActionSetAssertions>().And.NotBeNull();
        }
Exemplo n.º 2
0
        public void WithButtons_should_return_CardActionSetAssertions()
        {
            var buttons     = CardActionTestData.CreateRandomCardActions();
            var signinCards = SigninCardTestData.CreateSigninCardSetWithOneCardThatHasSetProperties(buttons: buttons);

            var sut = new SigninCardSetAssertions(signinCards);

            sut.WithButtons().Should().BeAssignableTo <CardActionSetAssertions>().And.NotBeNull();
        }
Exemplo n.º 3
0
        public void ImageMatching_should_throw_ArgumentNullException_if_regex_is_null()
        {
            var cardActions = CardActionTestData.CreateRandomCardActions();

            var sut = new CardActionSetAssertions(cardActions);

            Action act = () => sut.ImageMatching(null);

            act.ShouldThrow <ArgumentNullException>();
        }
Exemplo n.º 4
0
        public void ImageMatching_should_throw_CardActionAssertionFailedException_when_regex_matches_no_cards(string regex)
        {
            var cardActions = CardActionTestData.CreateRandomCardActions();

            var sut = new CardActionSetAssertions(cardActions);

            Action act = () => sut.ImageMatching(regex);

            act.ShouldThrow <CardActionAssertionFailedException>();
        }
Exemplo n.º 5
0
        public void ImageMatching_should_throw_ArgumentNullException_if_regex_is_null_when_matching_groups()
        {
            var cardActions = CardActionTestData.CreateRandomCardActions();

            var sut = new CardActionSetAssertions(cardActions);

            IList <string> matches;
            Action         act = () => sut.ImageMatching(null, "(.*)", out matches);

            act.ShouldThrow <ArgumentNullException>();
        }
Exemplo n.º 6
0
        public void ImageMatching_should_not_output_matches_when_groupMatchingRegex_does_not_match_Image_of_any_card()
        {
            IList <string> matches;

            var cardActions = CardActionTestData.CreateRandomCardActions();

            var sut = new CardActionSetAssertions(cardActions);

            sut.ImageMatching(".*", "(non matching)", out matches);

            matches.Should().BeNull();
        }
Exemplo n.º 7
0
        public void ValueMatching_should_throw_ArgumentNullException_if_groupMatchRegex_is_null()
        {
            IList <string> matches;

            var cardActions = CardActionTestData.CreateRandomCardActions();

            var sut = new CardActionSetAssertions(cardActions);

            Action act = () => sut.ValueMatching("(.*)", null, out matches);

            act.ShouldThrow <ArgumentNullException>();
        }
Exemplo n.º 8
0
        public void ImageMatching_should_not_output_matches_when_regex_does_not_match_Image_of_any_cards()
        {
            IList <string> matches = null;

            var cardActions = CardActionTestData.CreateRandomCardActions();

            var sut = new CardActionSetAssertions(cardActions);

            Action act = () => sut.ImageMatching("non matching regex", "(some text)", out matches);

            act.ShouldThrow <CardActionAssertionFailedException>();
            matches.Should().BeNull();
        }
        public void Only_non_null_CardActions_should_be_available_for_assertion()
        {
            var nonNullCardActions = CardActionTestData.CreateRandomCardActions();
            var inputList          = new List <CardAction> {
                null
            };

            inputList.AddRange(nonNullCardActions);

            var sut = new CardActionSetAssertions(inputList);

            sut.CardActions.ShouldBeEquivalentTo(nonNullCardActions);
        }
Exemplo n.º 10
0
        public void ImageMatching_should_output_multiple_matches_when_groupMatchingRegex_matches_Image_on_multiple_cards()
        {
            IList <string> matches;

            var cardActions = CardActionTestData.CreateRandomCardActions();

            cardActions.Add(new CardAction(image: "some text"));
            cardActions.Add(new CardAction(image: "same text"));

            var sut = new CardActionSetAssertions(cardActions);

            sut.ImageMatching(".*", @"(s[oa]me) (text)", out matches);

            matches.Should().Contain("some", "same", "text");
        }