public void Attachment_should_return_ActivityAttachmentAssertions() { var activity = new Activity(); var sut = new ActivityAssertions(activity); sut.WithAttachment().Should().BeAssignableTo <ActivityAttachmentAssertions>().And.NotBeNull(); }
public void FromMatching_should_pass_if_regex_exactly_matches_activity_From(string activityFromAndRegex) { var activity = new Activity(fromProperty: new ChannelAccount(name: activityFromAndRegex)); var sut = new ActivityAssertions(activity); Action act = () => sut.FromMatching(activityFromAndRegex); act.ShouldNotThrow <Exception>(); }
public void TextMatching_should_pass_if_regex_exactly_matches_activity_Text(string activityTextAndRegex) { var activity = new Activity(text: activityTextAndRegex); var sut = new ActivityAssertions(activity); Action act = () => sut.TextMatching(activityTextAndRegex); act.ShouldNotThrow <Exception>(); }
public void FromMatching_should_throw_ActivityAssertionFailedException_for_non_matching_regexes(string activityFrom, string regex) { var activity = new Activity(fromProperty: new ChannelAccount(name: activityFrom)); var sut = new ActivityAssertions(activity); Action act = () => sut.FromMatching(regex); act.ShouldThrow <ActivityAssertionFailedException>(); }
public void IdMatching_should_throw_ActivityAssertionFailedException_when_text_is_null() { var activity = new Activity(); var sut = new ActivityAssertions(activity); Action act = () => sut.IdMatching("anything"); act.ShouldThrow <ActivityAssertionFailedException>(); }
public void IdMatching_should_throw_ArgumentNullException_when_regex_is_null() { var activity = new Activity(id: "valid text"); var sut = new ActivityAssertions(activity); Action act = () => sut.IdMatching(null); act.ShouldThrow <ArgumentNullException>(); }
public void FromMatching_should_pass_when_using_standard_regex_features(string activityFrom, string regex) { var activity = new Activity(fromProperty: new ChannelAccount(name: activityFrom)); var sut = new ActivityAssertions(activity); Action act = () => sut.FromMatching(regex); act.ShouldNotThrow <Exception>(); }
public void FromMatching_should_throw_ArgumentNullException_when_regex_is_null() { var activity = new Activity(fromProperty: new ChannelAccount(name: "valid text")); var sut = new ActivityAssertions(activity); Action act = () => sut.FromMatching(null); act.ShouldThrow <ArgumentNullException>(); }
public void IdMatching_should_pass_if_regex_exactly_matches_activity_Id(string activityIdAndRegex) { var activity = new Activity(id: activityIdAndRegex); var sut = new ActivityAssertions(activity); Action act = () => sut.IdMatching(activityIdAndRegex); act.ShouldNotThrow <Exception>(); }
public void IdMatching_should_pass_regardless_of_case(string activityId, string regex) { var activity = new Activity(id: activityId); var sut = new ActivityAssertions(activity); Action act = () => sut.IdMatching(regex); act.ShouldNotThrow <Exception>(); }
public void IdMatching_should_pass_when_using_standard_regex_features(string activityId, string regex) { var activity = new Activity(id: activityId); var sut = new ActivityAssertions(activity); Action act = () => sut.IdMatching(regex); act.ShouldNotThrow <Exception>(); }
public void IdMatching_should_throw_ActivityAssertionFailedException_for_non_matching_regexes(string activityId, string regex) { var activity = new Activity(id: activityId); var sut = new ActivityAssertions(activity); Action act = () => sut.IdMatching(regex); act.ShouldThrow <ActivityAssertionFailedException>(); }
public void Like_returns_same_object_for_fluent_chaining() { var fixture = new Fixture(); var activity = fixture.Create <Activity>(); var sut = new ActivityAssertions(activity, _settings); var result = sut.ChannelIdLike($"^{activity.ChannelId}$"); result.Should().Be(sut); }
public void Pattern_that_does_not_match_throws() { var fixture = new Fixture(); var activity = fixture.Create <Activity>(); var sut = new ActivityAssertions(activity, _settings); Action act = () => sut.ChannelIdLike(".*NonMatchingPattern.*"); act.ShouldThrowExactly <BotSpecException>(); }
public void Exact_match_does_not_throw() { var fixture = new Fixture(); var activity = fixture.Create <Activity>(); var sut = new ActivityAssertions(activity, _settings); Action act = () => sut.IdIs(activity.Id); act.ShouldNotThrow(); }
public void Non_exact_match_throws() { var fixture = new Fixture(); var activity = fixture.Create <Activity>(); var sut = new ActivityAssertions(activity, _settings); Action act = () => sut.ChannelIdIs("NonMatchingId"); act.ShouldThrowExactly <BotSpecException>(); }
public void FromMatching_should_throw_ArgumentNullException_when_trying_to_capture_groups_but_regex_is_null() { IList <string> matches; var activity = new Activity(fromProperty: new ChannelAccount(name: "some text")); var sut = new ActivityAssertions(activity); Action act = () => sut.FromMatching(null, "(.*)", out matches); act.ShouldThrow <ArgumentNullException>(); }
public void Is_returns_same_object_for_fluent_chaining() { var fixture = new Fixture(); var activity = fixture.Create <Activity>(); var sut = new ActivityAssertions(activity, _settings); var result = sut.IdIs(activity.Id); result.Should().Be(sut); }
public void Pattern_match_does_not_throw() { var fixture = new Fixture(); var activity = fixture.Create <Activity>(); var sut = new ActivityAssertions(activity, _settings); Action act = () => sut.ChannelIdLike(".*"); act.ShouldNotThrow(); }
public void IdMatching_should_throw_ArgumentNullException_when_trying_to_capture_groups_but_regex_is_null() { IList <string> matches; var activity = new Activity(id: "some text"); var sut = new ActivityAssertions(activity); Action act = () => sut.IdMatching(null, "(.*)", out matches); act.ShouldThrow <ArgumentNullException>(); }
public void IdMatching_should_throw_ActivityAssertionFailedException_when_trying_to_capture_groups_but_text_is_null() { IList <string> matches; var activity = new Activity(); var sut = new ActivityAssertions(activity); Action act = () => sut.IdMatching("anything", "(.*)", out matches); act.ShouldThrow <ActivityAssertionFailedException>(); }
public void FromMatching_should_not_output_matches_when_groupMatchingRegex_does_not_match_text() { IList <string> matches; var activity = new Activity(fromProperty: new ChannelAccount(name: "some text")); var sut = new ActivityAssertions(activity); sut.FromMatching("some text", "(non matching)", out matches); matches.Should().BeNull(); }
public void FromMatching_should_throw_ArgumentNullException_when_groupMatchRegex_is_null() { IList <string> matches; var activity = new Activity(fromProperty: new ChannelAccount(name: "valid text")); var sut = new ActivityAssertions(activity); Action act = () => sut.FromMatching(".*", null, out matches); act.ShouldThrow <ArgumentNullException>(); }
public void IdMatching_should_throw_ArgumentNullException_when_groupMatchRegex_is_null() { IList <string> matches; var activity = new Activity(id: "valid text"); var sut = new ActivityAssertions(activity); Action act = () => sut.IdMatching(".*", null, out matches); act.ShouldThrow <ArgumentNullException>(); }
public void IdMatching_should_not_output_matches_when_groupMatchingRegex_does_not_match_text() { IList <string> matches; var activity = new Activity(id: "some text"); var sut = new ActivityAssertions(activity); sut.IdMatching("some text", "(non matching)", out matches); matches.Should().BeNull(); }
public void IdMatching_should_not_output_matches_when_regex_does_not_match_text() { IList <string> matches = null; var activity = new Activity(id: "some text"); var sut = new ActivityAssertions(activity); Action act = () => sut.IdMatching("non matching regex", "(some text)", out matches); act.ShouldThrow <ActivityAssertionFailedException>(); matches.Should().BeNull(); }
public void Non_messages_throw_when_trying_to_convert_to_IMessageAssertions() { var fixture = new Fixture(); var activity = fixture.Create <Activity>(); activity.Type = ActivityTypes.EndOfConversation; var sut = new ActivityAssertions(activity, _settings); Action act = () => sut.IsMessage(); act.ShouldThrowExactly <BotSpecException>(); }
public void FromMatching_should_output_matches_when_groupMatchingRegex_matches_text() { IList <string> matches; const string someFrom = "some text"; var activity = new Activity(fromProperty: new ChannelAccount(name: someFrom)); var sut = new ActivityAssertions(activity); sut.FromMatching(someFrom, $"({someFrom})", out matches); matches.First().Should().Be(someFrom); }
public void FromMatching_should_not_output_matches_when_regex_does_not_match_text() { IList <string> matches = null; var activity = new Activity(fromProperty: new ChannelAccount(name: "some text")); var sut = new ActivityAssertions(activity); Action act = () => sut.FromMatching("non matching regex", "(some text)", out matches); act.ShouldThrow <ActivityAssertionFailedException>(); matches.Should().BeNull(); }
public void IdMatching_should_output_matches_when_groupMatchingRegex_matches_text() { IList <string> matches; const string someId = "some text"; var activity = new Activity(id: someId); var sut = new ActivityAssertions(activity); sut.IdMatching(someId, $"({someId})", out matches); matches.First().Should().Be(someId); }