Skip to content

Commit 3618f86

Browse files
CopilotIhateTrains
andauthored
Fix StringWriter disposal in TraitMapperTests (#2907)
The `StringWriter` in `UnmappedImperatorTraitsAreLoggedUnlessExplicitlyDropped` test was not being disposed, violating IDisposable patterns. **Changes:** - Added `using` declaration to ensure `StringWriter` is properly disposed after test execution ```csharp // Before var output = new StringWriter(); Console.SetOut(output); // After using var output = new StringWriter(); Console.SetOut(output); ``` <!-- START COPILOT CODING AGENT TIPS --> --- 💬 We'd love your input! Share your thoughts on Copilot coding agent in our [2 minute survey](https://gh.io/copilot-coding-agent-survey). --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: IhateTrains <29546927+IhateTrains@users.noreply.github.com>
1 parent 3de1aab commit 3618f86

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

ImperatorToCK3.UnitTests/Mappers/Trait/TraitMapperTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ public void UnmappedImperatorTraitsAreLoggedUnlessExplicitlyDropped() {
134134
var mapper = new TraitMapper(tempTestFile, ck3ModFS);
135135

136136
var irModFS = new ModFilesystem("TestFiles/Imperator/game", new List<Mod>());
137-
var output = new StringWriter();
137+
using var output = new StringWriter();
138138
Console.SetOut(output);
139139

140140
mapper.LogUnmappedImperatorTraits(irModFS);

0 commit comments

Comments
 (0)