File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
tests/LinkDotNet.Blog.UnitTests/Web/Pages/Admin Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -16,15 +16,17 @@ namespace LinkDotNet.Blog.UnitTests.Web.Pages.Admin;
16
16
17
17
public class DashboardTests : TestContext
18
18
{
19
- [ Fact ]
20
- public void ShouldNotShowAboutMeStatisticsWhenDisabled ( )
19
+ [ Theory ]
20
+ [ InlineData ( true ) ]
21
+ [ InlineData ( false ) ]
22
+ public void ShouldShowAboutMeStatisticsAccordingToConfig ( bool aboutMeEnabled )
21
23
{
22
24
var options = new DbContextOptionsBuilder ( )
23
25
. UseSqlite ( CreateInMemoryConnection ( ) )
24
26
. Options ;
25
27
var dashboardService = new Mock < IDashboardService > ( ) ;
26
28
this . AddTestAuthorization ( ) . SetAuthorized ( "test" ) ;
27
- Services . AddScoped ( _ => CreateAppConfiguration ( false ) ) ;
29
+ Services . AddScoped ( _ => CreateAppConfiguration ( aboutMeEnabled ) ) ;
28
30
Services . AddScoped ( _ => dashboardService . Object ) ;
29
31
Services . AddScoped ( _ => Mock . Of < IRepository < BlogPost > > ( ) ) ;
30
32
Services . AddScoped ( _ => new BlogDbContext ( options ) ) ;
@@ -36,7 +38,7 @@ public void ShouldNotShowAboutMeStatisticsWhenDisabled()
36
38
cut . FindComponents < DashboardCard > ( )
37
39
. Any ( c => c . Instance . Text == "About Me:" )
38
40
. Should ( )
39
- . BeFalse ( ) ;
41
+ . Be ( aboutMeEnabled ) ;
40
42
}
41
43
42
44
private static AppConfiguration CreateAppConfiguration ( bool aboutMeEnabled )
You can’t perform that action at this time.
0 commit comments