File tree Expand file tree Collapse file tree 2 files changed +35
-0
lines changed Expand file tree Collapse file tree 2 files changed +35
-0
lines changed Original file line number Diff line number Diff line change
1
+ using Aspire . CommunityToolkit . Hosting . DataApiBuilder . BlazorApp ;
2
+ using Aspire . CommunityToolkit . Testing ;
3
+ using FluentAssertions ;
4
+ using Microsoft . TestUtilities ;
5
+ using System . Net . Http . Json ;
6
+
7
+ namespace Aspire . CommunityToolkit . Hosting . DataApiBuilder . Tests ;
8
+
9
+ public class ApiTests ( AspireIntegrationTestFixture < Projects . Aspire_CommunityToolkit_Hosting_DataApiBuilder_AppHost > fixture ) : IClassFixture < AspireIntegrationTestFixture < Projects . Aspire_CommunityToolkit_Hosting_DataApiBuilder_AppHost > >
10
+ {
11
+
12
+ [ ConditionalFact ]
13
+
14
+ public async Task CanGetSeries ( )
15
+ {
16
+
17
+ await fixture . ResourceNotificationService . WaitForResourceAsync ( "dab" , KnownResourceStates . Running ) . WaitAsync ( TimeSpan . FromMinutes ( 5 ) ) ;
18
+
19
+ var httpClient = fixture . CreateHttpClient ( "dab" , "http" ) ;
20
+
21
+ //Error: Unable to find config file: dab-config.json does not exist.
22
+
23
+ var response = await httpClient . GetAsync ( "/api/series" ) ;
24
+
25
+ response . StatusCode . Should ( ) . Be ( HttpStatusCode . OK ) ;
26
+ var series = await response . Content . ReadFromJsonAsync < SeriesList > ( ) ;
27
+ series . Should ( ) . NotBeNull ( ) ;
28
+ series . value . Should ( ) . NotBeNull ( ) ;
29
+ series . value . Should ( ) . HaveCount ( 5 ) ;
30
+ }
31
+
32
+
33
+ }
34
+
Original file line number Diff line number Diff line change 7
7
8
8
<ItemGroup >
9
9
<ProjectReference Include =" ..\..\examples\data-api-builder\Aspire.CommunityToolkit.Hosting.DataApiBuilder.AppHost\Aspire.CommunityToolkit.Hosting.DataApiBuilder.AppHost.csproj" />
10
+ <ProjectReference Include =" ..\..\examples\data-api-builder\Aspire.CommunityToolkit.Hosting.DataApiBuilder.BlazorApp\Aspire.CommunityToolkit.Hosting.DataApiBuilder.BlazorApp.csproj" />
10
11
<ProjectReference Include =" ..\Aspire.CommunityToolkit.Testing\Aspire.CommunityToolkit.Testing.csproj" />
11
12
</ItemGroup >
12
13
You can’t perform that action at this time.
0 commit comments