14 references to FromStream
Microsoft.CodeAnalysis (1)
CommandLine\CommonCompiler.cs (1)
414
return EmbeddedText.
FromStream
(filePath, stream, Arguments.ChecksumAlgorithm);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (2)
Compilation\CompilationAPITests.cs (2)
460
embeddedTexts: new[] { EmbeddedText.
FromStream
("_", new MemoryStream()) }));
466
embeddedTexts: new[] { EmbeddedText.
FromStream
("_", new MemoryStream()) }));
Microsoft.CodeAnalysis.UnitTests (11)
EmbeddedTextTests.cs (11)
49
Assert.Throws<ArgumentNullException>("filePath", () => EmbeddedText.
FromStream
(null, null));
50
Assert.Throws<ArgumentException>("filePath", () => EmbeddedText.
FromStream
("", null));
51
Assert.Throws<ArgumentNullException>("stream", () => EmbeddedText.
FromStream
("path", null));
52
Assert.Throws<ArgumentException>("stream", () => EmbeddedText.
FromStream
("path", new CannotReadStream()));
53
Assert.Throws<ArgumentException>("stream", () => EmbeddedText.
FromStream
("path", new CannotSeekStream()));
54
Assert.Throws<ArgumentException>("checksumAlgorithm", () => EmbeddedText.
FromStream
("path", new MemoryStream(), SourceHashAlgorithm.None));
60
Assert.Throws<IOException>(() => EmbeddedText.
FromStream
("path", new HugeStream()));
61
Assert.Throws<EndOfStreamException>(() => EmbeddedText.
FromStream
("path", new TruncatingStream(10)));
62
Assert.Throws<EndOfStreamException>(() => EmbeddedText.
FromStream
("path", new TruncatingStream(1000)));
63
Assert.Throws<IOException>(() => EmbeddedText.
FromStream
("path", new ReadFailsStream()));
91
var text = EmbeddedText.
FromStream
("pathToEmpty", new MemoryStream(new byte[0]), SourceHashAlgorithm.Sha1);