Skip to content

Commit a65aa6d

Browse files
committed
Added Startup Test
1 parent bd1d661 commit a65aa6d

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
using FluentAssertions;
2+
using LinkDotNet.Blog.Web;
3+
using LinkDotNet.Blog.Web.Pages.Admin;
4+
using LinkDotNet.Blog.Web.Shared;
5+
using LinkDotNet.Domain;
6+
using LinkDotNet.Infrastructure.Persistence;
7+
using Microsoft.AspNetCore;
8+
using Microsoft.AspNetCore.Hosting;
9+
using Microsoft.Extensions.DependencyInjection;
10+
using Xunit;
11+
12+
namespace LinkDotNet.Blog.IntegrationTests.Web
13+
{
14+
public class StartupTests
15+
{
16+
[Fact]
17+
public void ShouldSetServices()
18+
{
19+
var host = WebHost.CreateDefaultBuilder().UseStartup<Startup>().Build();
20+
21+
host.Services.GetRequiredService<IRepository<BlogPost>>().Should().NotBeNull();
22+
host.Services.GetRequiredService<ISortOrderCalculator>().Should().NotBeNull();
23+
host.Services.GetRequiredService<IDashboardService>().Should().NotBeNull();
24+
host.Services.GetRequiredService<IUserRecordService>().Should().NotBeNull();
25+
host.Services.GetRequiredService<AppConfiguration>().Should().NotBeNull();
26+
}
27+
}
28+
}

0 commit comments

Comments
 (0)