1
0
mirror of https://github.com/oliverbooth/X10D synced 2024-11-13 02:15:42 +00:00
X10D/X10D.Tests/src/IO/TextWriterTests.cs

47 lines
880 B
C#
Raw Normal View History

using System.Diagnostics;
using System.Text;
using NUnit.Framework;
namespace X10D.Tests.IO;
[TestFixture]
public partial class TextWriterTests
{
private MemoryStream _stream = null!;
private StreamWriter _writer = null!;
[OneTimeSetUp]
public void OneTimeSetup()
{
_stream = new MemoryStream();
_writer = new StreamWriter(_stream, Encoding.UTF8);
_writer.Write(' ');
_writer.Flush();
_stream.SetLength(0);
_stream.Position = 0;
Trace.Listeners.Add(new ConsoleTraceListener());
}
[OneTimeTearDown]
public void OneTimeTearDown()
{
_writer.Dispose();
_stream.Dispose();
Trace.Flush();
}
[SetUp]
public void Setup()
{
_stream.SetLength(0);
}
[TearDown]
public void TearDown()
{
_stream.SetLength(0);
}
}