Skip to content

Commit 965bbda

Browse files
committed
Replace all invalid PostAsync with Get DTOs to use Send which infers method to use
1 parent 4dce797 commit 965bbda

8 files changed

+21
-21
lines changed

AiServer.Tests/QueueImageServiceTests.cs

+6-6
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@ public async Task Can_convert_image_to_png()
4545
Assert.That(response, Is.Not.Null);
4646

4747
// Verify that we can get the job status
48-
var getStatusResponse = await client.PostAsync(new GetArtifactGenerationStatus
48+
var getStatusResponse = await client.SendAsync(new GetArtifactGenerationStatus
4949
{
5050
JobId = response.JobId
5151
});
5252

5353
while (getStatusResponse.JobState is BackgroundJobState.Queued or BackgroundJobState.Started)
5454
{
5555
await Task.Delay(1000);
56-
getStatusResponse = await client.PostAsync(new GetArtifactGenerationStatus
56+
getStatusResponse = await client.SendAsync(new GetArtifactGenerationStatus
5757
{
5858
JobId = response.JobId
5959
});
@@ -103,15 +103,15 @@ public async Task Can_convert_image_to_jpeg()
103103
Assert.That(response, Is.Not.Null);
104104

105105
// Verify that we can get the job status
106-
var getStatusResponse = await client.PostAsync(new GetArtifactGenerationStatus
106+
var getStatusResponse = await client.SendAsync(new GetArtifactGenerationStatus
107107
{
108108
JobId = response.JobId
109109
});
110110

111111
while (getStatusResponse.JobState is BackgroundJobState.Queued or BackgroundJobState.Started)
112112
{
113113
await Task.Delay(1000);
114-
getStatusResponse = await client.PostAsync(new GetArtifactGenerationStatus
114+
getStatusResponse = await client.SendAsync(new GetArtifactGenerationStatus
115115
{
116116
JobId = response.JobId
117117
});
@@ -212,15 +212,15 @@ public async Task Can_crop_image()
212212
Assert.That(response, Is.Not.Null);
213213

214214
// Verify that we can get the job status
215-
var getStatusResponse = await client.PostAsync(new GetArtifactGenerationStatus
215+
var getStatusResponse = await client.SendAsync(new GetArtifactGenerationStatus
216216
{
217217
JobId = response.JobId
218218
});
219219

220220
while (getStatusResponse.JobState is BackgroundJobState.Queued or BackgroundJobState.Started)
221221
{
222222
await Task.Delay(1000);
223-
getStatusResponse = await client.PostAsync(new GetArtifactGenerationStatus
223+
getStatusResponse = await client.SendAsync(new GetArtifactGenerationStatus
224224
{
225225
JobId = response.JobId
226226
});

AiServer.Tests/QueueImageToImageTests.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -134,15 +134,15 @@ public async Task Can_generate_image_without_sync_or_reply_to()
134134
Assert.That(response.JobState is BackgroundJobState.Started or BackgroundJobState.Queued, Is.True);
135135

136136
// Verify that we can get the job status
137-
var getStatusResponse = await client.PostAsync(new GetArtifactGenerationStatus
137+
var getStatusResponse = await client.SendAsync(new GetArtifactGenerationStatus
138138
{
139139
JobId = response.JobId
140140
});
141141

142142
while (getStatusResponse.JobState == BackgroundJobState.Queued || getStatusResponse.JobState == BackgroundJobState.Started)
143143
{
144144
await Task.Delay(1000);
145-
getStatusResponse = await client.PostAsync(new GetArtifactGenerationStatus
145+
getStatusResponse = await client.SendAsync(new GetArtifactGenerationStatus
146146
{
147147
JobId = response.JobId
148148
});

AiServer.Tests/QueueImageToTextTests.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -128,15 +128,15 @@ public async Task Can_convert_image_to_text_without_sync_or_reply_to()
128128
Assert.That(response.JobState is BackgroundJobState.Started or BackgroundJobState.Queued, Is.True);
129129

130130
// Verify that we can get the job status
131-
var getStatusResponse = await client.PostAsync(new GetArtifactGenerationStatus
131+
var getStatusResponse = await client.SendAsync(new GetArtifactGenerationStatus
132132
{
133133
JobId = response.JobId
134134
});
135135

136136
while (getStatusResponse.JobState == BackgroundJobState.Queued || getStatusResponse.JobState == BackgroundJobState.Started)
137137
{
138138
await Task.Delay(1000);
139-
getStatusResponse = await client.PostAsync(new GetArtifactGenerationStatus
139+
getStatusResponse = await client.SendAsync(new GetArtifactGenerationStatus
140140
{
141141
JobId = response.JobId
142142
});

AiServer.Tests/QueueImageUpscaleTests.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -129,15 +129,15 @@ public async Task Can_upscale_image_without_sync_or_reply_to()
129129
Assert.That(response.JobState is BackgroundJobState.Started or BackgroundJobState.Queued, Is.True);
130130

131131
// Verify that we can get the job status
132-
var getStatusResponse = await client.PostAsync(new GetArtifactGenerationStatus
132+
var getStatusResponse = await client.SendAsync(new GetArtifactGenerationStatus
133133
{
134134
JobId = response.JobId
135135
});
136136

137137
while (getStatusResponse.JobState == BackgroundJobState.Queued || getStatusResponse.JobState == BackgroundJobState.Started)
138138
{
139139
await Task.Delay(1000);
140-
getStatusResponse = await client.PostAsync(new GetArtifactGenerationStatus
140+
getStatusResponse = await client.SendAsync(new GetArtifactGenerationStatus
141141
{
142142
JobId = response.JobId
143143
});

AiServer.Tests/QueueImageWithMaskTests.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -146,15 +146,15 @@ public async Task Can_generate_image_with_mask_without_sync_or_reply_to()
146146
Assert.That(response.JobState is BackgroundJobState.Started or BackgroundJobState.Queued, Is.True);
147147

148148
// Verify that we can get the job status
149-
var getStatusResponse = await client.PostAsync(new GetArtifactGenerationStatus
149+
var getStatusResponse = await client.SendAsync(new GetArtifactGenerationStatus
150150
{
151151
JobId = response.JobId
152152
});
153153

154154
while (getStatusResponse.JobState == BackgroundJobState.Queued || getStatusResponse.JobState == BackgroundJobState.Started)
155155
{
156156
await Task.Delay(1000);
157-
getStatusResponse = await client.PostAsync(new GetArtifactGenerationStatus
157+
getStatusResponse = await client.SendAsync(new GetArtifactGenerationStatus
158158
{
159159
JobId = response.JobId
160160
});

AiServer.Tests/QueueSpeechToTextTests.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public async Task Can_transcribe_speech_with_reply_to()
110110
Assert.That(hasRepyTo.Succeeded, Is.True);
111111

112112
// Verify that we can get the job status
113-
var getStatusResponse = await client.PostAsync(new GetArtifactGenerationStatus
113+
var getStatusResponse = await client.SendAsync(new GetArtifactGenerationStatus
114114
{
115115
JobId = response.JobId
116116
});
@@ -147,15 +147,15 @@ public async Task Can_transcribe_speech_without_sync_or_reply_to()
147147
Assert.True(response.JobState is BackgroundJobState.Queued or BackgroundJobState.Started);
148148

149149
// Verify that we can get the job status
150-
var getStatusResponse = await client.PostAsync(new GetTextGenerationStatus
150+
var getStatusResponse = await client.SendAsync(new GetTextGenerationStatus
151151
{
152152
JobId = response.JobId
153153
});
154154

155155
while (getStatusResponse.JobState == BackgroundJobState.Queued || getStatusResponse.JobState == BackgroundJobState.Started)
156156
{
157157
await Task.Delay(1000);
158-
getStatusResponse = await client.PostAsync(new GetTextGenerationStatus
158+
getStatusResponse = await client.SendAsync(new GetTextGenerationStatus
159159
{
160160
JobId = response.JobId
161161
});

AiServer.Tests/QueueTextToImageTests.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -161,15 +161,15 @@ public async Task Can_generate_image_without_sync_or_reply_to()
161161
Assert.That(response.JobState is BackgroundJobState.Started or BackgroundJobState.Queued, Is.True);
162162

163163
// Verify that we can get the job status
164-
var getStatusResponse = await client.PostAsync(new GetArtifactGenerationStatus
164+
var getStatusResponse = await client.SendAsync(new GetArtifactGenerationStatus
165165
{
166166
JobId = response.JobId
167167
});
168168

169169
while (getStatusResponse.JobState == BackgroundJobState.Queued || getStatusResponse.JobState == BackgroundJobState.Started)
170170
{
171171
await Task.Delay(1000);
172-
getStatusResponse = await client.PostAsync(new GetArtifactGenerationStatus
172+
getStatusResponse = await client.SendAsync(new GetArtifactGenerationStatus
173173
{
174174
JobId = response.JobId
175175
});

AiServer.Tests/QueueTextToSpeechTests.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -119,15 +119,15 @@ public async Task Can_generate_speech_without_sync_or_reply_to()
119119
Assert.True(response.JobState is BackgroundJobState.Queued or BackgroundJobState.Started or BackgroundJobState.Completed);
120120

121121
// Verify that we can get the job status
122-
var getStatusResponse = await client.PostAsync(new GetArtifactGenerationStatus
122+
var getStatusResponse = await client.SendAsync(new GetArtifactGenerationStatus
123123
{
124124
JobId = response.JobId
125125
});
126126

127127
while (getStatusResponse.JobState == BackgroundJobState.Queued || getStatusResponse.JobState == BackgroundJobState.Started)
128128
{
129129
await Task.Delay(1000);
130-
getStatusResponse = await client.PostAsync(new GetArtifactGenerationStatus
130+
getStatusResponse = await client.SendAsync(new GetArtifactGenerationStatus
131131
{
132132
JobId = response.JobId
133133
});

0 commit comments

Comments
 (0)