Skip to content

Commit

Permalink
Use a StringWriter instead of a temp file.
Browse files Browse the repository at this point in the history
  • Loading branch information
bgrainger committed Nov 24, 2023
1 parent 9f99887 commit 108c4f3
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Tests/ResxDataNodeTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,11 @@ public void ResxDataNode_CreateForResXFileRef()
Assert.Equal("Test", dataNode.Name);
Assert.Equal(Example.FileRef, dataNode.GetValue(typeResolver));

var tempFilePath = Path.GetTempFileName();
using (ResXResourceWriter resx = new ResXResourceWriter(tempFilePath))
StringBuilder resxOutput = new StringBuilder();
using (ResXResourceWriter resx = new ResXResourceWriter(new StringWriter(resxOutput)))
{
resx.AddResource(dataNode);
}
File.Delete(tempFilePath);
}

[Fact]
Expand Down

0 comments on commit 108c4f3

Please sign in to comment.