40 references to From
BuildValidator (1)
Microsoft.CodeAnalysis (3)
Microsoft.CodeAnalysis.CodeStyle (1)
Microsoft.CodeAnalysis.CSharp.Scripting (1)
Microsoft.CodeAnalysis.Features (1)
Microsoft.CodeAnalysis.Features.Test.Utilities (1)
Microsoft.CodeAnalysis.Rebuild (1)
Microsoft.CodeAnalysis.Scripting (1)
Microsoft.CodeAnalysis.UnitTests (27)
Text\SourceTextTests.cs (17)
64Assert.Same(s_unicode, SourceText.From(stream, s_unicode).Encoding);
65Assert.Equal(utf8NoBOM, SourceText.From(stream, null).Encoding);
78Assert.Equal(utf8BOM, SourceText.From(stream, s_unicode).Encoding);
79Assert.Equal(utf8BOM, SourceText.From(stream, null).Encoding);
91Assert.Equal(SourceHashAlgorithm.Sha1, SourceText.From(stream).ChecksumAlgorithm);
105Assert.Equal(algorithm, SourceText.From(stream, checksumAlgorithm: algorithm).ChecksumAlgorithm);
141verifyChecksumAndContentHash(SourceText.From(streamNoBOM, null, checksumAlgorithm), checksumNoBOM, expectedContentHash);
142verifyChecksumAndContentHash(SourceText.From(streamNoBOM, encodingNoBOM, checksumAlgorithm), checksumNoBOM, expectedContentHash);
143verifyChecksumAndContentHash(SourceText.From(streamNoBOM, encodingBOM, checksumAlgorithm), checksumNoBOM, expectedContentHash);
146verifyChecksumAndContentHash(SourceText.From(streamBOM, null, checksumAlgorithm), checksumBOM, expectedContentHash);
147verifyChecksumAndContentHash(SourceText.From(streamBOM, encodingNoBOM, checksumAlgorithm), checksumBOM, expectedContentHash);
148verifyChecksumAndContentHash(SourceText.From(streamBOM, encodingBOM, checksumAlgorithm), checksumBOM, expectedContentHash);
172verifyChecksumAndContentHash(fromChanges(SourceText.From(streamNoBOM, encodingNoBOM, checksumAlgorithm)), checksumNoBOM, expectedContentHash);
173verifyChecksumAndContentHash(fromChanges(SourceText.From(streamNoBOM, encodingBOM, checksumAlgorithm)), checksumBOM, expectedContentHash);
176verifyChecksumAndContentHash(fromChanges(SourceText.From(streamBOM, encodingNoBOM, checksumAlgorithm)), checksumBOM, expectedContentHash);
177verifyChecksumAndContentHash(fromChanges(SourceText.From(streamBOM, encodingBOM, checksumAlgorithm)), checksumBOM, expectedContentHash);
346Assert.Throws<InvalidDataException>(() => SourceText.From(stream, throwIfBinaryDetected: true));
Microsoft.CodeAnalysis.Workspaces (1)
Microsoft.VisualStudio.LanguageServices (1)
Microsoft.VisualStudio.LanguageServices.Xaml (1)