public void SubtitleMatching_should_throw_ThumbnailCardAssertionFailedException_when_regex_matches_no_cards(string regex) { var cards = ThumbnailCardTestData.CreateRandomThumbnailCards(); var sut = new ThumbnailCardSetAssertions(cards); Action act = () => sut.SubtitleMatching(regex); act.ShouldThrow <ThumbnailCardAssertionFailedException>(); }
public void SubtitleMatching_should_throw_ArgumentNullException_if_regex_is_null() { var cards = ThumbnailCardTestData.CreateRandomThumbnailCards(); var sut = new ThumbnailCardSetAssertions(cards); Action act = () => sut.SubtitleMatching(null); act.ShouldThrow <ArgumentNullException>(); }
public void SubtitleMatching_should_throw_ArgumentNullException_if_groupMatchRegex_is_null() { IList <string> matches; var cards = ThumbnailCardTestData.CreateRandomThumbnailCards(); var sut = new ThumbnailCardSetAssertions(cards); Action act = () => sut.SubtitleMatching("(.*)", null, out matches); act.ShouldThrow <ArgumentNullException>(); }
public void SubtitleMatching_should_not_output_matches_when_groupMatchingRegex_does_not_match_Subtitle_of_any_card() { IList <string> matches; var cards = ThumbnailCardTestData.CreateRandomThumbnailCards(); var sut = new ThumbnailCardSetAssertions(cards); sut.SubtitleMatching(".*", "(non matching)", out matches); matches.Should().BeNull(); }
public void TextMatching_should_throw_ArgumentNullException_when_capturing_groups_if_regex_is_null() { IList <string> matches; var cards = ThumbnailCardTestData.CreateRandomThumbnailCards(); var sut = new ThumbnailCardSetAssertions(cards); Action act = () => sut.TextMatching(null, "(.*)", out matches); act.ShouldThrow <ArgumentNullException>(); }
public void SubtitleMatching_should_not_output_matches_when_regex_does_not_match_Subtitle_of_any_cards() { IList <string> matches = null; var cards = ThumbnailCardTestData.CreateRandomThumbnailCards(); var sut = new ThumbnailCardSetAssertions(cards); Action act = () => sut.SubtitleMatching("non matching regex", "(some text)", out matches); act.ShouldThrow <ThumbnailCardAssertionFailedException>(); matches.Should().BeNull(); }
public void Extracted_thumbnail_cards_are_used_to_create_thumbnail_card_set_assertions() { var thumbnailCards = ThumbnailCardTestData.CreateRandomThumbnailCards(); _extractor.ExtractCards <ThumbnailCard>(Arg.Any <IEnumerable <Activity> >()).Returns(thumbnailCards); var sut = new ActivitySetAttachmentAssertions(ActivityTestData.CreateRandomActivities()); var result = sut.OfTypeThumbnailCard(); result.Should().BeAssignableTo <ThumbnailCardSetAssertions>(); var assertions = (ThumbnailCardSetAssertions)result; assertions.ThumbnailCards.ShouldBeEquivalentTo(thumbnailCards); }
public void SubtitleMatching_should_output_multiple_matches_when_groupMatchingRegex_matches_Subtitle_on_multiple_cards() { IList <string> matches; var cards = ThumbnailCardTestData.CreateRandomThumbnailCards(); cards.Add(new ThumbnailCard(subtitle: "some text")); cards.Add(new ThumbnailCard(subtitle: "same text")); var sut = new ThumbnailCardSetAssertions(cards); sut.SubtitleMatching(".*", @"(s[oa]me) (text)", out matches); matches.Should().Contain("some", "same", "text"); }