public void KeyMatching_should_pass_when_using_standard_regex_features(string key, string regex) { var facts = FactTestData.CreateFactSetWithOneFactThatHasSetProperties(key: key); var sut = new FactSetAssertions(facts); Action act = () => sut.KeyMatching(regex); act.ShouldNotThrow <Exception>(); }
public void KeyMatching_should_pass_if_regex_exactly_matches_Key_of_at_least_1_card_regardless_of_case(string key, string regex) { var facts = FactTestData.CreateFactSetWithOneFactThatHasSetProperties(key: key); var sut = new FactSetAssertions(facts); Action act = () => sut.KeyMatching(regex); act.ShouldNotThrow <Exception>(); }
public void KeyMatching_should_pass_if_regex_exactly_matches_message_Key_of_one_card(string keyAndRegex) { var facts = FactTestData.CreateFactSetWithOneFactThatHasSetProperties(key: keyAndRegex); var sut = new FactSetAssertions(facts); Action act = () => sut.KeyMatching(keyAndRegex); act.ShouldNotThrow <Exception>(); }
public void KeyMatching_should_output_matches_when_groupMatchingRegex_matches_Key_of_any_card() { IList <string> matches; const string someKey = "some text"; var facts = FactTestData.CreateFactSetWithOneFactThatHasSetProperties(key: someKey); var sut = new FactSetAssertions(facts); sut.KeyMatching(someKey, $"({someKey})", out matches); matches.First().Should().Be(someKey); }
public void KeyMatching_should_output_multiple_matches_when_groupMatchingRegex_matches_Key_several_times_for_a_single_card() { IList <string> matches; const string someKey = "some text"; var facts = FactTestData.CreateFactSetWithOneFactThatHasSetProperties(key: someKey); var sut = new FactSetAssertions(facts); const string match1 = "some"; const string match2 = "text"; sut.KeyMatching(someKey, $"({match1}) ({match2})", out matches); matches.Should().Contain(match1, match2); }