Skip to content

Commit 7ab72d9

Browse files
committed
Added smoke test
1 parent e19d315 commit 7ab72d9

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

LinkDotNet.Blog.IntegrationTests/LinkDotNet.Blog.IntegrationTests.csproj

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
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 numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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+
}

0 commit comments

Comments
 (0)