20 references to From
Microsoft.AspNetCore.Http.Extensions.Tests (1)
Microsoft.AspNetCore.Http.Microbenchmarks (1)
Microsoft.CodeAnalysis (3)
Text\SourceText.cs (2)
226=> From(buffer, length, encoding, checksumAlgorithm, throwIfBinaryDetected, canBeEmbedded: false);
424/// If this text was constructed via <see cref="From(byte[], int, Encoding, SourceHashAlgorithm, bool, bool)"/> or
Microsoft.CodeAnalysis.CodeStyle (1)
Microsoft.CodeAnalysis.Features.UnitTests (1)
Microsoft.CodeAnalysis.UnitTests (12)
Text\SourceTextTests.cs (10)
60Assert.Same(s_unicode, SourceText.From(bytes, bytes.Length, s_unicode).Encoding);
61Assert.Equal(utf8NoBOM, SourceText.From(bytes, bytes.Length, null).Encoding);
74Assert.Equal(utf8BOM, SourceText.From(bytes, bytes.Length, s_unicode).Encoding);
75Assert.Equal(utf8BOM, SourceText.From(bytes, bytes.Length, null).Encoding);
88Assert.Equal(SourceHashAlgorithm.Sha1, SourceText.From(bytes, bytes.Length).ChecksumAlgorithm);
102Assert.Equal(algorithm, SourceText.From(bytes, bytes.Length, checksumAlgorithm: algorithm).ChecksumAlgorithm);
136verifyChecksumAndContentHash(SourceText.From(bytesBOM, bytesBOM.Length, null, checksumAlgorithm), checksumBOM, expectedContentHash);
137verifyChecksumAndContentHash(SourceText.From(bytesBOM, bytesBOM.Length, encodingNoBOM, checksumAlgorithm), checksumBOM, expectedContentHash);
138verifyChecksumAndContentHash(SourceText.From(bytesBOM, bytesBOM.Length, encodingBOM, checksumAlgorithm), checksumBOM, expectedContentHash);
343Assert.Throws<InvalidDataException>(() => SourceText.From(bytes, bytes.Length, throwIfBinaryDetected: true));
Microsoft.CodeAnalysis.Workspaces (1)