-
Notifications
You must be signed in to change notification settings - Fork 162
Surrealdb test fix #1237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Surrealdb test fix #1237
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -14,16 +14,25 @@ public class AppHostTests(AspireIntegrationTestFixture<Projects.CommunityToolkit | |||||||||||||
| public async Task SurrealResourceStartsAndRespondsOk() | ||||||||||||||
| { | ||||||||||||||
| const string resourceName = "surreal"; | ||||||||||||||
| await fixture.ResourceNotificationService.WaitForResourceHealthyAsync(resourceName).WaitAsync(TimeSpan.FromMinutes(1)); | ||||||||||||||
| var evt = await fixture.ResourceNotificationService.WaitForResourceHealthyAsync(resourceName).WaitAsync(TimeSpan.FromMinutes(1)); | ||||||||||||||
|
|
||||||||||||||
| Assert.Equal(KnownResourceStates.Running, evt.Snapshot.State); | ||||||||||||||
|
|
||||||||||||||
| var tcpUri = fixture.GetEndpoint(resourceName, "tcp"); | ||||||||||||||
| var baseUri = new Uri(tcpUri.AbsoluteUri.Replace("tcp://", "http://")); | ||||||||||||||
| var httpClient = new HttpClient(); | ||||||||||||||
| httpClient.BaseAddress = baseUri; | ||||||||||||||
| var handler = new HttpClientHandler | ||||||||||||||
| { | ||||||||||||||
| AllowAutoRedirect = false | ||||||||||||||
| }; | ||||||||||||||
| var httpClient = new HttpClient(handler) | ||||||||||||||
| { | ||||||||||||||
| BaseAddress = baseUri | ||||||||||||||
| }; | ||||||||||||||
|
|
||||||||||||||
| var response = await httpClient.GetAsync("/"); | ||||||||||||||
|
|
||||||||||||||
|
Comment on lines
+23
to
33
|
||||||||||||||
| Assert.Equal(HttpStatusCode.OK, response.StatusCode); | ||||||||||||||
| Assert.Equal(HttpStatusCode.RedirectKeepVerb, response.StatusCode); | ||||||||||||||
| Assert.Equal("https://surrealdb.com/surrealist", response.Headers.Location?.AbsoluteUri); | ||||||||||||||
|
||||||||||||||
| Assert.Equal("https://surrealdb.com/surrealist", response.Headers.Location?.AbsoluteUri); | |
| var redirectLocation = response.Headers.Location; | |
| Assert.NotNull(redirectLocation); | |
| Assert.Equal("surrealdb.com", redirectLocation.Host); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
evt.Snapshot.Stateis aResourceStateSnapshot(see other tests using.State?.Text), so comparing it directly toKnownResourceStates.Runningwill never match (and may be a type mismatch depending on overload resolution). Compare againstevt.Snapshot.State?.Text(or assertevt.Snapshot.HealthStatusisHealthyif that’s what you want to validate here).