File tree Expand file tree Collapse file tree 2 files changed +45
-30
lines changed
LinkDotNet.Blog.IntegrationTests Expand file tree Collapse file tree 2 files changed +45
-30
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ using System . Threading . Tasks ;
2
+ using FluentAssertions ;
3
+ using LinkDotNet . Blog . Infrastructure . Persistence ;
4
+ using LinkDotNet . Blog . Web ;
5
+ using Microsoft . AspNetCore . Mvc . Testing ;
6
+ using Xunit ;
7
+
8
+ namespace LinkDotNet . Blog . IntegrationTests ;
9
+
10
+ public class SmokeTests : IClassFixture < WebApplicationFactory < Program > >
11
+ {
12
+ private readonly WebApplicationFactory < Program > factory ;
13
+
14
+ public SmokeTests ( WebApplicationFactory < Program > factory )
15
+ {
16
+ this . factory = factory . WithWebHostBuilder ( builder =>
17
+ {
18
+ builder . UseSetting ( "PersistenceProvider" , PersistenceProvider . InMemory . Key ) ;
19
+ } ) ;
20
+ }
21
+
22
+ [ Fact ]
23
+ public async Task ShouldBootUpApplication ( )
24
+ {
25
+ var client = factory . CreateClient ( ) ;
26
+
27
+ var result = await client . GetAsync ( "/" ) ;
28
+
29
+ result . IsSuccessStatusCode . Should ( ) . BeTrue ( ) ;
30
+ }
31
+
32
+ [ Fact ]
33
+ public async Task ShouldBootUpWithSqlDatabase ( )
34
+ {
35
+ var client = factory . WithWebHostBuilder ( builder =>
36
+ {
37
+ builder . UseSetting ( "PersistenceProvider" , PersistenceProvider . SqliteServer . Key ) ;
38
+ builder . UseSetting ( "ConnectionString" , "DataSource=file::memory:?cache=shared" ) ;
39
+ } ) . CreateClient ( ) ;
40
+
41
+ var result = await client . GetAsync ( "/" ) ;
42
+
43
+ result . IsSuccessStatusCode . Should ( ) . BeTrue ( ) ;
44
+ }
45
+ }
You can’t perform that action at this time.
0 commit comments