Skip to content

Commit

Permalink
Image Generations (WIP)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisSimmons committed Mar 26, 2024
1 parent 24d5477 commit 17b9ff9
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions UnitTests/AiGenerator/GenerateImagesTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@

namespace UnitTests.AiGenerator;

// TODO POST /v3/ai/image-generations
// TODO Support a one-step call to generate and get images?
public class GenerateImagesTests : IAsyncLifetime
{
private image_generations_request _requestPayload;
private image_generations_request? _requestPayload;

Check warning on line 12 in UnitTests/AiGenerator/GenerateImagesTests.cs

View workflow job for this annotation

GitHub Actions / build

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
private string _absoluteUri;

public async Task InitializeAsync()
{
Expand All @@ -30,8 +29,11 @@ await ApiClient.GetApiClientWithClientCredentials("apiKey", "apiSecret", testHan
ProjectCode = "some project code"
})
.ExecuteAsync();
// TODO Support a one-step call to generate and get images?

_requestPayload = await testHandler.Request.Content!.ReadFromJsonAsync<image_generations_request>();
_absoluteUri = testHandler.Request.RequestUri!.AbsoluteUri;

_requestPayload = await testHandler.Request.Content.ReadFromJsonAsync<image_generations_request>();
}

[Fact]
Expand All @@ -52,6 +54,12 @@ public void MediaTypeIsAttached()
_requestPayload.media_type.Should().Be("photography");
}

[Fact]
public void UriIsExpected()
{
_absoluteUri.Should().Be("https://api.gettyimages.com/v3/ai/image-generations");
}

public class image_generations_request
{
public string prompt { get; set; }
Expand Down

0 comments on commit 17b9ff9

Please sign in to comment.