public void ShouldWriteToMemory() { var mock = MockRepository.GenerateStub<IFileSystemHelper>(); var subject = new AssemblyInfoDetails(new CSharpAssemblyInfoBuilder(), mock); var outputpath = "IDONTEXIST"; var inMemoryFile = new MemoryStream(); mock.Stub(x => x.CreateFile(outputpath)).Return(inMemoryFile); ((AssemblyInfoDetails)subject.Copyright("TEST").OutputPath(outputpath)).InternalExecute(); Assert.That(inMemoryFile.GetBuffer().Length, Is.GreaterThan(0)); }
public void ShouldWriteToMemory() { var mock = MockRepository.GenerateStub <IFileSystemHelper>(); var subject = new AssemblyInfoDetails(new CSharpAssemblyInfoBuilder(), mock); var outputpath = "IDONTEXIST"; var inMemoryFile = new MemoryStream(); mock.Stub(x => x.CreateFile(outputpath)).Return(inMemoryFile); ((AssemblyInfoDetails)subject.Copyright("TEST").OutputPath(outputpath)).InternalExecute(); Assert.That(inMemoryFile.GetBuffer().Length, Is.GreaterThan(0)); }