Skip to content

Commit 747abc7

Browse files
committed
Added Smoke Test
1 parent f4a9e31 commit 747abc7

File tree

4 files changed

+28
-1
lines changed

4 files changed

+28
-1
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<ItemGroup>
99
<PackageReference Include="bunit" Version="1.3.42" />
1010
<PackageReference Include="FluentAssertions" Version="6.2.0" />
11+
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="6.0.0" />
1112
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="6.0.0" />
1213
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.1.0-preview-20211130-02" />
1314
<PackageReference Include="Moq" Version="4.16.1" />
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
using System.Threading.Tasks;
2+
using FluentAssertions;
3+
using LinkDotNet.Blog.Web;
4+
using Microsoft.AspNetCore.Mvc.Testing;
5+
using Xunit;
6+
7+
namespace LinkDotNet.Blog.IntegrationTests
8+
{
9+
public class SmokeTest
10+
{
11+
[Fact]
12+
public async Task ShouldBootUpApplication()
13+
{
14+
var application = new WebApplicationFactory<Program>().WithWebHostBuilder(b => { });
15+
var client = application.CreateClient();
16+
17+
var result = await client.GetAsync("/");
18+
19+
result.IsSuccessStatusCode.Should().BeTrue();
20+
}
21+
}
22+
}

LinkDotNet.Blog.Web/LinkDotNet.Blog.Web.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@
3636
<AdditionalFiles Include="..\stylecop.json" Link="stylecop.json" />
3737
</ItemGroup>
3838

39+
<ItemGroup>
40+
<InternalsVisibleTo Include="LinkDotNet.Blog.IntegrationTests" />
41+
</ItemGroup>
42+
3943
<ItemGroup>
4044
<None Update="Shared\Giscus.razor.js">
4145
<DependentUpon>Giscus.razor</DependentUpon>

LinkDotNet.Blog.Web/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
namespace LinkDotNet.Blog.Web;
1010

11-
public static class Program
11+
public class Program
1212
{
1313
public static void Main(string[] args)
1414
{

0 commit comments

Comments
 (0)