File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Test/UnitTests/TestDataLayer Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -81,7 +81,13 @@ public void TestEnsureDeletedEnsureCreatedOk()
8181 public async Task TestEnsureCreatedAndEmptyPostgreSqlOk ( )
8282 {
8383 //SETUP
84- var options = this . CreatePostgreSqlUniqueDatabaseOptions < BookContext > ( ) ;
84+ var logOptions = new LogToOptions
85+ {
86+ ShowLog = false ,
87+ LogLevel = Microsoft . Extensions . Logging . LogLevel . Debug ,
88+ LoggerOptions = Microsoft . EntityFrameworkCore . Diagnostics . DbContextLoggerOptions . UtcTime
89+ } ;
90+ var options = this . CreatePostgreSqlUniqueClassOptionsWithLogTo < BookContext > ( log => _output . WriteLine ( log ) , logOptions ) ;
8591 using ( var context = new BookContext ( options ) )
8692 {
8793 context . Database . EnsureCreated ( ) ;
@@ -90,10 +96,12 @@ public async Task TestEnsureCreatedAndEmptyPostgreSqlOk()
9096 using ( var context = new BookContext ( options ) )
9197 {
9298 //ATTEMPT
99+ logOptions . ShowLog = true ;
93100 using ( new TimeThings ( _output , "Time to empty database" ) )
94101 {
95102 await context . EnsureCreatedAndEmptyPostgreSqlAsync ( ) ;
96103 }
104+ logOptions . ShowLog = false ;
97105
98106 //VERIFY
99107 context . Books . Count ( ) . ShouldEqual ( 0 ) ;
You can’t perform that action at this time.
0 commit comments