5
5
using Xunit ;
6
6
using Xunit . Abstractions ;
7
7
8
- namespace Serilog . Sinks . MSSqlServer . Tests
8
+ namespace Serilog . Sinks . MSSqlServer . Tests . Misc
9
9
{
10
10
[ Trait ( TestCategory . TraitName , TestCategory . Integration ) ]
11
11
public class CustomStandardColumnNamesTests : DatabaseTestsBase
@@ -19,7 +19,7 @@ public CustomStandardColumnNamesTests(ITestOutputHelper output) : base(output)
19
19
public void CustomIdColumnLegacyInterface ( )
20
20
{
21
21
// Arrange
22
- var options = new Serilog . Sinks . MSSqlServer . ColumnOptions ( ) ;
22
+ var options = new MSSqlServer . ColumnOptions ( ) ;
23
23
var customIdName = "CustomIdName" ;
24
24
options . Id . ColumnName = customIdName ;
25
25
@@ -35,7 +35,7 @@ public void CustomIdColumnLegacyInterface()
35
35
public void CustomIdColumnSinkOptionsInterface ( )
36
36
{
37
37
// Arrange
38
- var columnOptions = new Serilog . Sinks . MSSqlServer . ColumnOptions ( ) ;
38
+ var columnOptions = new MSSqlServer . ColumnOptions ( ) ;
39
39
var customIdName = "CustomIdName" ;
40
40
columnOptions . Id . ColumnName = customIdName ;
41
41
@@ -60,7 +60,7 @@ public void CustomIdColumnSinkOptionsInterface()
60
60
public void DefaultIdColumnLegacyInterface ( )
61
61
{
62
62
// Arrange
63
- var options = new Serilog . Sinks . MSSqlServer . ColumnOptions ( ) ;
63
+ var options = new MSSqlServer . ColumnOptions ( ) ;
64
64
65
65
// Act
66
66
using ( var sink = new MSSqlServerSink ( DatabaseFixture . LogEventsConnectionString , DatabaseFixture . LogTableName , 1 , TimeSpan . FromSeconds ( 1 ) , null , true , options , "dbo" , null ) )
@@ -74,7 +74,7 @@ public void DefaultIdColumnLegacyInterface()
74
74
public void DefaultIdColumnSinkOptionsInterface ( )
75
75
{
76
76
// Arrange
77
- var columnOptions = new Serilog . Sinks . MSSqlServer . ColumnOptions ( ) ;
77
+ var columnOptions = new MSSqlServer . ColumnOptions ( ) ;
78
78
79
79
// Act
80
80
using ( var sink = new MSSqlServerSink ( DatabaseFixture . LogEventsConnectionString ,
@@ -97,7 +97,7 @@ public void DefaultIdColumnSinkOptionsInterface()
97
97
public void TableCreatedWithCustomNamesLegacyInterface ( )
98
98
{
99
99
// Arrange
100
- var options = new Serilog . Sinks . MSSqlServer . ColumnOptions ( ) ;
100
+ var options = new MSSqlServer . ColumnOptions ( ) ;
101
101
var standardNames = new List < string > { "CustomMessage" , "CustomMessageTemplate" , "CustomLevel" , "CustomTimeStamp" , "CustomException" , "CustomProperties" } ;
102
102
103
103
options . Message . ColumnName = "CustomMessage" ;
@@ -119,7 +119,7 @@ public void TableCreatedWithCustomNamesLegacyInterface()
119
119
public void TableCreatedWithCustomNamesSinkOptionsInterface ( )
120
120
{
121
121
// Arrange
122
- var columnOptions = new Serilog . Sinks . MSSqlServer . ColumnOptions ( ) ;
122
+ var columnOptions = new MSSqlServer . ColumnOptions ( ) ;
123
123
var standardNames = new List < string > { "CustomMessage" , "CustomMessageTemplate" , "CustomLevel" , "CustomTimeStamp" , "CustomException" , "CustomProperties" } ;
124
124
125
125
columnOptions . Message . ColumnName = "CustomMessage" ;
@@ -150,7 +150,7 @@ public void TableCreatedWithCustomNamesSinkOptionsInterface()
150
150
public void TableCreatedWithDefaultNamesLegacyInterface ( )
151
151
{
152
152
// Arrange
153
- var options = new Serilog . Sinks . MSSqlServer . ColumnOptions ( ) ;
153
+ var options = new MSSqlServer . ColumnOptions ( ) ;
154
154
var standardNames = new List < string > { "Message" , "MessageTemplate" , "Level" , "TimeStamp" , "Exception" , "Properties" } ;
155
155
156
156
// Act
@@ -165,7 +165,7 @@ public void TableCreatedWithDefaultNamesLegacyInterface()
165
165
public void TableCreatedWithDefaultNamesSinkOptionsInterface ( )
166
166
{
167
167
// Arrange
168
- var columnOptions = new Serilog . Sinks . MSSqlServer . ColumnOptions ( ) ;
168
+ var columnOptions = new MSSqlServer . ColumnOptions ( ) ;
169
169
var standardNames = new List < string > { "Message" , "MessageTemplate" , "Level" , "TimeStamp" , "Exception" , "Properties" } ;
170
170
171
171
// Act
@@ -189,7 +189,7 @@ public void TableCreatedWithDefaultNamesSinkOptionsInterface()
189
189
public void WriteEventToCustomStandardColumnsLegacyInterface ( )
190
190
{
191
191
// Arrange
192
- var options = new Serilog . Sinks . MSSqlServer . ColumnOptions ( ) ;
192
+ var options = new MSSqlServer . ColumnOptions ( ) ;
193
193
194
194
options . Message . ColumnName = "CustomMessage" ;
195
195
options . MessageTemplate . ColumnName = "CustomMessageTemplate" ;
@@ -211,7 +211,7 @@ public void WriteEventToCustomStandardColumnsLegacyInterface()
211
211
const string loggingInformationMessage = "Logging Information message" ;
212
212
using ( var file = File . CreateText ( "CustomColumnsEvent.Self.log" ) )
213
213
{
214
- Serilog . Debugging . SelfLog . Enable ( TextWriter . Synchronized ( file ) ) ;
214
+ Debugging . SelfLog . Enable ( TextWriter . Synchronized ( file ) ) ;
215
215
Log . Information ( loggingInformationMessage ) ;
216
216
Log . CloseAndFlush ( ) ;
217
217
}
@@ -224,7 +224,7 @@ public void WriteEventToCustomStandardColumnsLegacyInterface()
224
224
public void WriteEventToCustomStandardColumnsSinkOptionsInterface ( )
225
225
{
226
226
// Arrange
227
- var options = new Serilog . Sinks . MSSqlServer . ColumnOptions ( ) ;
227
+ var options = new MSSqlServer . ColumnOptions ( ) ;
228
228
229
229
options . Message . ColumnName = "CustomMessage" ;
230
230
options . MessageTemplate . ColumnName = "CustomMessageTemplate" ;
@@ -249,7 +249,7 @@ public void WriteEventToCustomStandardColumnsSinkOptionsInterface()
249
249
const string loggingInformationMessage = "Logging Information message" ;
250
250
using ( var file = File . CreateText ( "CustomColumnsEvent.Self.log" ) )
251
251
{
252
- Serilog . Debugging . SelfLog . Enable ( TextWriter . Synchronized ( file ) ) ;
252
+ Debugging . SelfLog . Enable ( TextWriter . Synchronized ( file ) ) ;
253
253
Log . Information ( loggingInformationMessage ) ;
254
254
Log . CloseAndFlush ( ) ;
255
255
}
@@ -270,14 +270,14 @@ public void WriteEventToDefaultStandardColumnsLegacyInterface()
270
270
autoCreateSqlTable : true ,
271
271
batchPostingLimit : 1 ,
272
272
period : TimeSpan . FromSeconds ( 10 ) ,
273
- columnOptions : new Serilog . Sinks . MSSqlServer . ColumnOptions ( ) )
273
+ columnOptions : new MSSqlServer . ColumnOptions ( ) )
274
274
. CreateLogger ( ) ;
275
275
276
276
// Act
277
277
const string loggingInformationMessage = "Logging Information message" ;
278
278
using ( var file = File . CreateText ( "StandardColumns.Self.log" ) )
279
279
{
280
- Serilog . Debugging . SelfLog . Enable ( TextWriter . Synchronized ( file ) ) ;
280
+ Debugging . SelfLog . Enable ( TextWriter . Synchronized ( file ) ) ;
281
281
Log . Information ( loggingInformationMessage ) ;
282
282
Log . CloseAndFlush ( ) ;
283
283
}
@@ -300,14 +300,14 @@ public void WriteEventToDefaultStandardColumnsSinkOptionsInterface()
300
300
BatchPostingLimit = 1 ,
301
301
BatchPeriod = TimeSpan . FromSeconds ( 10 )
302
302
} ,
303
- columnOptions : new Serilog . Sinks . MSSqlServer . ColumnOptions ( ) )
303
+ columnOptions : new MSSqlServer . ColumnOptions ( ) )
304
304
. CreateLogger ( ) ;
305
305
306
306
// Act
307
307
const string loggingInformationMessage = "Logging Information message" ;
308
308
using ( var file = File . CreateText ( "StandardColumns.Self.log" ) )
309
309
{
310
- Serilog . Debugging . SelfLog . Enable ( TextWriter . Synchronized ( file ) ) ;
310
+ Debugging . SelfLog . Enable ( TextWriter . Synchronized ( file ) ) ;
311
311
Log . Information ( loggingInformationMessage ) ;
312
312
Log . CloseAndFlush ( ) ;
313
313
}
@@ -321,7 +321,7 @@ public void WriteEventToDefaultStandardColumnsSinkOptionsInterface()
321
321
public void AuditEventToCustomStandardColumnsLegacyInterface ( )
322
322
{
323
323
// Arrange
324
- var options = new Serilog . Sinks . MSSqlServer . ColumnOptions ( ) ;
324
+ var options = new MSSqlServer . ColumnOptions ( ) ;
325
325
326
326
options . Message . ColumnName = "CustomMessage" ;
327
327
options . MessageTemplate . ColumnName = "CustomMessageTemplate" ;
@@ -343,7 +343,7 @@ public void AuditEventToCustomStandardColumnsLegacyInterface()
343
343
const string loggingInformationMessage = "Logging Information message" ;
344
344
using ( var file = File . CreateText ( "CustomColumnsAuditEvent.Self.log" ) )
345
345
{
346
- Serilog . Debugging . SelfLog . Enable ( TextWriter . Synchronized ( file ) ) ;
346
+ Debugging . SelfLog . Enable ( TextWriter . Synchronized ( file ) ) ;
347
347
Log . Information ( loggingInformationMessage ) ;
348
348
Log . CloseAndFlush ( ) ;
349
349
}
@@ -356,7 +356,7 @@ public void AuditEventToCustomStandardColumnsLegacyInterface()
356
356
public void AuditEventToCustomStandardColumnsSinkOptionsInterface ( )
357
357
{
358
358
// Arrange
359
- var options = new Serilog . Sinks . MSSqlServer . ColumnOptions ( ) ;
359
+ var options = new MSSqlServer . ColumnOptions ( ) ;
360
360
361
361
options . Message . ColumnName = "CustomMessage" ;
362
362
options . MessageTemplate . ColumnName = "CustomMessageTemplate" ;
@@ -381,7 +381,7 @@ public void AuditEventToCustomStandardColumnsSinkOptionsInterface()
381
381
const string loggingInformationMessage = "Logging Information message" ;
382
382
using ( var file = File . CreateText ( "CustomColumnsAuditEvent.Self.log" ) )
383
383
{
384
- Serilog . Debugging . SelfLog . Enable ( TextWriter . Synchronized ( file ) ) ;
384
+ Debugging . SelfLog . Enable ( TextWriter . Synchronized ( file ) ) ;
385
385
Log . Information ( loggingInformationMessage ) ;
386
386
Log . CloseAndFlush ( ) ;
387
387
}
@@ -402,14 +402,14 @@ public void AuditEventToDefaultStandardColumns()
402
402
TableName = DatabaseFixture . LogTableName ,
403
403
AutoCreateSqlTable = true
404
404
} ,
405
- columnOptions : new Serilog . Sinks . MSSqlServer . ColumnOptions ( ) )
405
+ columnOptions : new MSSqlServer . ColumnOptions ( ) )
406
406
. CreateLogger ( ) ;
407
407
408
408
// Act
409
409
const string loggingInformationMessage = "Logging Information message" ;
410
410
using ( var file = File . CreateText ( "StandardColumns.Audit.Self.log" ) )
411
411
{
412
- Serilog . Debugging . SelfLog . Enable ( TextWriter . Synchronized ( file ) ) ;
412
+ Debugging . SelfLog . Enable ( TextWriter . Synchronized ( file ) ) ;
413
413
414
414
Log . Information ( loggingInformationMessage ) ;
415
415
Log . CloseAndFlush ( ) ;
0 commit comments