In this example the .Stub returns a new memory stream. The same memory stream is returned both times. What I want is a new memory stream every time. My question is, how do I change the .Stub in order to make this test pass?
[TestMethod]
public void Meh()
{
var mockFileSystem = MockRepository.GenerateMock<IFileSystemService>();
mockFileSystem.Stub(fs => fs.CreateFileStream(null, FileMode.Append, FileAccess.Write, FileShare.None))
.IgnoreArguments()
.Return(new MemoryStream());
var result1 = mockFileSystem.CreateFileStream(null, FileMode.Append, FileAccess.Write, FileShare.None);
var result2 = mockFileSystem.CreateFileStream(null, FileMode.Append, FileAccess.Write, FileShare.None);
Assert.AreNotSame(result1, result2);
}