44 references to From
BuildValidator (1)
Microsoft.CodeAnalysis (3)
Microsoft.CodeAnalysis.CodeStyle (1)
Microsoft.CodeAnalysis.CSharp.Scripting (1)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (2)
Microsoft.CodeAnalysis.Features (1)
Microsoft.CodeAnalysis.Rebuild (1)
Microsoft.CodeAnalysis.Scripting (1)
Microsoft.CodeAnalysis.UnitTests (28)
Text\SourceTextTests.cs (18)
30TestIsEmpty(SourceText.From(new MemoryStream()));
54Assert.Same(s_unicode, SourceText.From(stream, s_unicode).Encoding);
55Assert.Equal(utf8NoBOM, SourceText.From(stream, null).Encoding);
68Assert.Equal(utf8BOM, SourceText.From(stream, s_unicode).Encoding);
69Assert.Equal(utf8BOM, SourceText.From(stream, null).Encoding);
81Assert.Equal(SourceHashAlgorithm.Sha1, SourceText.From(stream).ChecksumAlgorithm);
95Assert.Equal(algorithm, SourceText.From(stream, checksumAlgorithm: algorithm).ChecksumAlgorithm);
131VerifyChecksum(SourceText.From(streamNoBOM, null, checksumAlgorithm), checksumNoBOM);
132VerifyChecksum(SourceText.From(streamNoBOM, encodingNoBOM, checksumAlgorithm), checksumNoBOM);
133VerifyChecksum(SourceText.From(streamNoBOM, encodingBOM, checksumAlgorithm), checksumNoBOM);
136VerifyChecksum(SourceText.From(streamBOM, null, checksumAlgorithm), checksumBOM);
137VerifyChecksum(SourceText.From(streamBOM, encodingNoBOM, checksumAlgorithm), checksumBOM);
138VerifyChecksum(SourceText.From(streamBOM, encodingBOM, checksumAlgorithm), checksumBOM);
162VerifyChecksum(FromChanges(SourceText.From(streamNoBOM, encodingNoBOM, checksumAlgorithm)), checksumNoBOM);
163VerifyChecksum(FromChanges(SourceText.From(streamNoBOM, encodingBOM, checksumAlgorithm)), checksumBOM);
166VerifyChecksum(FromChanges(SourceText.From(streamBOM, encodingNoBOM, checksumAlgorithm)), checksumBOM);
167VerifyChecksum(FromChanges(SourceText.From(streamBOM, encodingBOM, checksumAlgorithm)), checksumBOM);
243Assert.Throws<InvalidDataException>(() => SourceText.From(stream, throwIfBinaryDetected: true));
Microsoft.CodeAnalysis.Workspaces (1)
Microsoft.VisualStudio.LanguageServices (1)
Microsoft.VisualStudio.LanguageServices.VisualBasic (1)
Microsoft.VisualStudio.LanguageServices.Xaml (1)
Roslyn.VisualStudio.DiagnosticsWindow (1)