File tree Expand file tree Collapse file tree 2 files changed +30
-0
lines changed
LinkDotNet.Blog.IntegrationTests Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change 88 <ItemGroup >
99 <PackageReference Include =" bunit" Version =" 1.2.49" />
1010 <PackageReference Include =" FluentAssertions" Version =" 6.1.0" />
11+ <PackageReference Include =" Microsoft.AspNetCore.Mvc.Testing" Version =" 6.0.0-rc.1.21452.15" />
1112 <PackageReference Include =" Microsoft.EntityFrameworkCore.Sqlite" Version =" 6.0.0-rc.1.21452.10" />
1213 <PackageReference Include =" Microsoft.NET.Test.Sdk" Version =" 16.11.0" />
1314 <PackageReference Include =" Moq" Version =" 4.16.1" />
Original file line number Diff line number Diff line change 1+ using System . Net ;
2+ using System . Threading . Tasks ;
3+ using FluentAssertions ;
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 < Startup > >
11+ {
12+ private readonly WebApplicationFactory < Startup > factory ;
13+
14+ public SmokeTests ( WebApplicationFactory < Startup > factory )
15+ {
16+ this . factory = factory ;
17+ }
18+
19+ [ Fact ]
20+ public async Task ShouldStart ( )
21+ {
22+ var client = factory . CreateClient ( ) ;
23+
24+ var response = await client . GetAsync ( "/" ) ;
25+
26+ response . StatusCode . Should ( ) . Be ( HttpStatusCode . OK ) ;
27+ }
28+ }
29+ }
You can’t perform that action at this time.
0 commit comments