public void ShouldOpenFileAndReadStream() { var mockstream = new Mock <Stream>(); mockstream.Setup(x => x.CanRead).Returns(true); var streamreader = new StreamReader(mockstream.Object); _csvWriter.Open(Filename); var stream = _csvWriter.GetWriter(); Assert.That(stream, Is.EqualTo(streamreader)); _csvWriter.Close(); }