Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -282,29 +282,6 @@ public async Task GetSubredditImageUrlAsync_ImageKeyExistsAndIsAccessible_Return
result.ShouldBe(imageUrl);
}

[Theory]
[InlineData("programming")]
[InlineData("learnprogramming")]
[InlineData("AskReddit")]
[InlineData("funny")]
public async Task GetSubredditImageUrlAsync_ValidSubredditName_CallsCorrectAboutUrl(string subredditName)
{
// Arrange
var expectedUrl = $"https://www.reddit.com/r/{subredditName}/about.json";
var json = JsonSerializer.Serialize(new { data = new { } });

var mockHandler = new MockHttpMessageHandler(json, System.Net.HttpStatusCode.OK);
var httpClient = new HttpClient(mockHandler);
_mockHttpClientFactory.CreateClient("BreefDownloader").Returns(httpClient);

// Act
await _extractor.GetSubredditImageUrlAsync(subredditName);

// Assert
// Since we're using MockHttpMessageHandler, we can't easily verify the exact URL called
// The test passes if no exception is thrown and the method completes successfully
}

[Fact]
public async Task GetSubredditImageUrlAsync_NoImageKeysExist_ReturnsFallbackImageUrl()
{
Expand Down
Loading