public void GivenRedditPostWithNoVideo_WhenVideoUrlIsParsedFromPost_ThenRedditPostParserExceptionIsThrown() { // Arrange var post = new Post(); // Act + Assert Invoking(() => RedditPostParser.TryGetVideoUrlFromPost(post)) .Should().Throw <RedditPostParserException>(); }
public void GivenRedditPostWithNonVideoMedia_WhenVideoUrlIsParsedFromPost_ThenRedditPostParserExceptionIsThrown() { // Arrange var post = new Post { Media = JObject.Parse("{\"some_other_media\":{\"data\":\"value\"}}") }; // Act + Assert Invoking(() => RedditPostParser.TryGetVideoUrlFromPost(post)) .Should().Throw <RedditPostParserException>(); }
public void GivenRedditPostWithVideoWithAlternativeVideoUrl_WhenVideoUrlIsParsedFromPost_ThenUrlIsReturnedSuccessfully() { // Arrange var post = new Post { Media = JObject.Parse(MediaVariationString) }; // Act var url = RedditPostParser.TryGetVideoUrlFromPost(post); // Assert Assert.Equal(VideoUrlVariationString, url); }