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(); }
public void TextMatching_should_pass_when_using_standard_regex_features(string cardText, string regex) { var cards = SigninCardTestData.CreateSigninCardSetWithOneCardThatHasSetProperties(text: cardText); var sut = new SigninCardSetAssertions(cards); Action act = () => sut.TextMatching(regex); act.ShouldNotThrow <Exception>(); }
public void TextMatching_should_pass_if_regex_exactly_matches_Text_of_at_least_1_card_regardless_of_case(string cardText, string regex) { var cards = SigninCardTestData.CreateSigninCardSetWithOneCardThatHasSetProperties(text: cardText); var sut = new SigninCardSetAssertions(cards); Action act = () => sut.TextMatching(regex); act.ShouldNotThrow <Exception>(); }
public void TextMatching_should_pass_if_regex_exactly_matches_message_Text_of_one_card(string cardTextAndRegex) { var cards = SigninCardTestData.CreateSigninCardSetWithOneCardThatHasSetProperties(text: cardTextAndRegex); var sut = new SigninCardSetAssertions(cards); Action act = () => sut.TextMatching(cardTextAndRegex); act.ShouldNotThrow <Exception>(); }
public void TextMatching_should_output_matches_when_groupMatchingRegex_matches_Text_of_any_card() { IList <string> matches; const string someText = "some text"; var cards = SigninCardTestData.CreateSigninCardSetWithOneCardThatHasSetProperties(text: someText); var sut = new SigninCardSetAssertions(cards); sut.TextMatching(someText, $"({someText})", out matches); matches.First().Should().Be(someText); }
public void TextMatching_should_output_multiple_matches_when_groupMatchingRegex_matches_Text_several_times_for_a_single_card() { IList <string> matches; const string someText = "some text"; var cards = SigninCardTestData.CreateSigninCardSetWithOneCardThatHasSetProperties(text: someText); var sut = new SigninCardSetAssertions(cards); const string match1 = "some"; const string match2 = "text"; sut.TextMatching(someText, $"({match1}) ({match2})", out matches); matches.Should().Contain(match1, match2); }