43 references to TestStream
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (4)
CommandLineTests.cs (4)
8997return new TestStream(backingStream: new MemoryStream(), 9020return new TestStream(backingStream: new MemoryStream(), 9042return new TestStream(backingStream: new MemoryStream(), 9066return new TestStream(backingStream: new MemoryStream(Encoding.UTF8.GetBytes(@"
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (1)
Emit\ResourceTests.cs (1)
889var stream = new TestStream(
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (2)
PDB\PDBSourceLinkTests.cs (1)
119var sourceLinkStream = new TestStream(canRead: true, readFunc: (_, __, ___) => { throw new Exception("Error!"); });
PDB\PortablePdbTests.cs (1)
379var sourceLinkStream = new TestStream(canRead: true, readFunc: (_, __, ___) => { throw new Exception("Error!"); });
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (8)
Compilation\CompilationAPITests.cs (8)
382var peStream = new TestStream(canRead: false, canSeek: false, canWrite: false); 383var pdbStream = new TestStream(canRead: false, canSeek: false, canWrite: false); 447Assert.Throws<ArgumentException>("peStream", () => comp.Emit(peStream: new TestStream(canRead: true, canWrite: false, canSeek: true))); 448Assert.Throws<ArgumentException>("pdbStream", () => comp.Emit(peStream: new MemoryStream(), pdbStream: new TestStream(canRead: true, canWrite: false, canSeek: true))); 455sourceLinkStream: new TestStream(canRead: false, canWrite: true, canSeek: true))); 471win32Resources: new TestStream(canRead: true, canWrite: false, canSeek: false))); 475win32Resources: new TestStream(canRead: false, canWrite: false, canSeek: true))); 481xmlDocumentationStream: new TestStream(canRead: true, canWrite: false, canSeek: true)).Success);
Microsoft.CodeAnalysis.CSharp.WinRT.UnitTests (2)
PdbTests.cs (2)
105var peStream = new TestStream(canRead: false, canSeek: false, canWrite: true); 106var pdbStream = new TestStream(canRead: false, canSeek: false, canWrite: true);
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (4)
Debugging\DebugInformationReaderProviderTests.cs (2)
18Assert.Throws<ArgumentException>(() => DebugInformationReaderProvider.CreateFromStream(new TestStream(canRead: false, canSeek: true, canWrite: true))); 19Assert.Throws<ArgumentException>(() => DebugInformationReaderProvider.CreateFromStream(new TestStream(canRead: true, canSeek: false, canWrite: true)));
Emit\CompilationOutputsTests.cs (2)
40openAssemblyStream: () => new TestStream(canRead, canSeek, canWrite: true), 41openPdbStream: () => new TestStream(canRead, canSeek, canWrite: true));
Microsoft.CodeAnalysis.UnitTests (12)
InternalUtilities\StreamExtensionsTests.cs (8)
24var stream = new TestStream(readFunc: (buf, offset, count) => 48var stream = new TestStream(readFunc: (_1, _2, _3) => { throw new IOException(); }); 51stream = new TestStream(readFunc: (buf, offset, count) => 69var stream = new TestStream(readFunc: (buf, offset, count) => 95var stream = new TestStream(readFunc: (buf, offset, count) => 132var stream = new TestStream(canSeek: canSeek, backingStream: new MemoryStream(sourceArray)); 143var stream = new TestStream(canSeek: canSeek, backingStream: new MemoryStream(sourceArray)); 155var stream = new TestStream(canSeek: canSeek, backingStream: new MemoryStream(sourceArray), length: 3);
MetadataReferences\ModuleMetadataTests.cs (2)
110Assert.Throws<ArgumentException>(() => ModuleMetadata.CreateFromStream(new TestStream(canRead: false, canSeek: true))); 111Assert.Throws<ArgumentException>(() => ModuleMetadata.CreateFromStream(new TestStream(canRead: true, canSeek: false)));
Text\StringTextTest.cs (2)
76Assert.Throws<ArgumentException>(() => SourceText.From(new TestStream(canRead: false, canSeek: true), Encoding.UTF8)); 77Assert.Throws<NotImplementedException>(() => SourceText.From(new TestStream(canRead: true, canSeek: false), Encoding.UTF8));
Microsoft.CodeAnalysis.VisualBasic.CommandLine.UnitTests (4)
CommandLineTests.vb (4)
9586Return New TestStream(backingStream:=New MemoryStream(), dispose:=Sub() Throw New IOException("Fake IOException")) 9606Return New TestStream(backingStream:=New MemoryStream(), dispose:=Sub() Throw New IOException("Fake IOException")) 9625Return New TestStream(backingStream:=New MemoryStream(), dispose:=Sub() Throw New IOException("Fake IOException")) 9646Return New TestStream(
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (6)
Compilation\CompilationAPITests.vb (6)
453Assert.Throws(Of ArgumentException)("peStream", Sub() comp.Emit(peStream:=New TestStream(canRead:=True, canWrite:=False, canSeek:=True))) 454Assert.Throws(Of ArgumentException)("pdbStream", Sub() comp.Emit(peStream:=New MemoryStream(), pdbStream:=New TestStream(canRead:=True, canWrite:=False, canSeek:=True))) 461sourceLinkStream:=New TestStream(canRead:=False, canWrite:=True, canSeek:=True))) 477win32Resources:=New TestStream(canRead:=True, canWrite:=False, canSeek:=False))) 481win32Resources:=New TestStream(canRead:=False, canWrite:=False, canSeek:=True))) 487xmlDocumentationStream:=New TestStream(canRead:=True, canWrite:=False, canSeek:=True)).Success)