Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: prevent more spurious file creation #4

Merged
merged 1 commit into from
Feb 1, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Chickensoft.Log.Tests/test/src/FileWriterTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,17 @@ public void DefaultFileName() {

[Fact]
public void DefaultInstance() {
using var tester = new FileWriterStreamTester();

var writer = FileWriter.Instance();
writer.ShouldNotBeNull();
writer.ShouldBeOfType<FileWriter>();
}

[Fact]
public void NewInstance() {
using var tester = new FileWriterStreamTester();

var filename = "test.log";
var writer = FileWriter.Instance(filename);
writer.ShouldNotBeNull();
Expand All @@ -73,6 +77,8 @@ public void NewInstance() {

[Fact]
public void ReusesInstanceAndRemoves() {
using var tester = new FileWriterStreamTester();

var filename = "test.log";
var writer1 = FileWriter.Instance(filename);
var writer2 = FileWriter.Instance(filename);
Expand Down