99
1010namespace BrowserGuard . Tests . NetLogger
1111{
12- public class NetLogWriterTests : IDisposable
12+ public class NetLogFileWriterTests : IDisposable
1313 {
1414 readonly string tempDir ;
1515
16- public NetLogWriterTests ( )
16+ public NetLogFileWriterTests ( )
1717 {
1818 tempDir = Path . Combine ( Path . GetTempPath ( ) , "browserguard-netlog-" + Guid . NewGuid ( ) . ToString ( "N" ) ) ;
1919 // Several tests put a day's file in place before the writer runs.
@@ -25,7 +25,7 @@ public void Dispose()
2525 try { Directory . Delete ( tempDir , true ) ; } catch { }
2626 }
2727
28- NetLogWriter Writer ( int maxDays = 30 , int maxSizeMB = 0 ) =>
28+ NetLogFileWriter Writer ( int maxDays = 30 , int maxSizeMB = 0 ) =>
2929 new ( new NetLogFileConfig
3030 {
3131 Enabled = true ,
@@ -76,7 +76,7 @@ public void WritesOneLinePerEntry()
7676 [ Fact ]
7777 public void CreatesTheDirectory ( )
7878 {
79- var writer = new NetLogWriter ( new NetLogFileConfig
79+ var writer = new NetLogFileWriter ( new NetLogFileConfig
8080 {
8181 Enabled = true ,
8282 Directory = Path . Combine ( tempDir , "nested" ) ,
@@ -372,7 +372,7 @@ public void ReportsAFailureRatherThanThrowing()
372372 Directory . CreateDirectory ( tempDir ) ;
373373 var blocked = Path . Combine ( tempDir , "blocked" ) ;
374374 File . WriteAllText ( blocked , "x" ) ;
375- var writer = new NetLogWriter ( new NetLogFileConfig
375+ var writer = new NetLogFileWriter ( new NetLogFileConfig
376376 {
377377 Enabled = true ,
378378 Directory = blocked ,
@@ -388,7 +388,7 @@ public void ExpandsTheMacrosInTheDirectory()
388388 {
389389 var configured = Path . Combine ( tempDir , "%PCNAME%" , "%DATE%" ) ;
390390
391- var resolved = NetLogWriter . ResolveDirectory ( configured , new DateTime ( 2026 , 8 , 20 ) ) ;
391+ var resolved = NetLogFileWriter . ResolveDirectory ( configured , new DateTime ( 2026 , 8 , 20 ) ) ;
392392
393393 Assert . Equal (
394394 Path . Combine ( tempDir , Environment . MachineName , "2026-08-20" ) ,
@@ -404,7 +404,7 @@ public void ExpandsAnEnvironmentVariableInTheDirectory()
404404 {
405405 Assert . Equal (
406406 Path . Combine ( tempDir , "netlog" ) ,
407- NetLogWriter . ResolveDirectory ( Path . Combine ( "%BROWSERGUARD_LOGS%" , "netlog" ) ) ) ;
407+ NetLogFileWriter . ResolveDirectory ( Path . Combine ( "%BROWSERGUARD_LOGS%" , "netlog" ) ) ) ;
408408 }
409409 finally
410410 {
@@ -422,7 +422,7 @@ public void WritesIntoTheDirectoryTheMacrosNamed()
422422 Directory = Path . Combine ( tempDir , "%PCNAME%" ) ,
423423 } ;
424424
425- var writer = new NetLogWriter ( config ) ;
425+ var writer = new NetLogFileWriter ( config ) ;
426426 writer . Write ( """{"operation":"browsing"}""" ) ;
427427
428428 var expected = Path . Combine ( tempDir , Environment . MachineName , "netlog.jsonl" ) ;
@@ -432,7 +432,7 @@ public void WritesIntoTheDirectoryTheMacrosNamed()
432432 [ Fact ]
433433 public void FallsBackToProgramDataWhenNoDirectoryIsGiven ( )
434434 {
435- var writer = new NetLogWriter ( new NetLogFileConfig { Enabled = true } ) ;
435+ var writer = new NetLogFileWriter ( new NetLogFileConfig { Enabled = true } ) ;
436436
437437 var expected = Path . Combine (
438438 Environment . GetFolderPath ( Environment . SpecialFolder . CommonApplicationData ) ,
0 commit comments