Stream was not readable
TL;DR - flush & reset, see: [Fact] public void BaseStream_Is_Not_Empty() { MemoryStream stream = new MemoryStream(); LogWriter logWriter = new LogWriter(stream); logWriter.WriteLine(new[] { DateTime.Now.ToString("yyyy-MM-dd"), "Log data" }); logWriter.BaseStream.AutoFlush = true; stream.Seek(0, SeekOrigin.Begin); using (StreamReader sr = new StreamReader(stream)) { Assert.NotEmpty(sr.ReadToEnd()); } } I recently started writing some tests (in xUnit using Moq + StructureMap) for a service that calls a class -- let's call it LogWriter -- that simply writes formatted logging data to a Stream. After creating an interface for the logging class, ILogWriter, I wanted to write some tests on LogWriter to see if it was working as expected (before testing out my service which depends on ILogWriter). After the ILogWriter was done, I used StreamReader to check out it's input. The Stream I told it to write to was a MemoryStream (this is unit testin...