20 references to From
Microsoft.AspNetCore.Http.Extensions.Tests (1)
RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (1)
139var sourceText = SourceText.From(buffer, buffer.Length, encoding, canBeEmbedded: true);
Microsoft.AspNetCore.Http.Microbenchmarks (1)
src\Http\Http.Extensions\test\RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (1)
139var sourceText = SourceText.From(buffer, buffer.Length, encoding, canBeEmbedded: true);
Microsoft.CodeAnalysis (3)
EncodedStringText.cs (1)
146return SourceText.From(bytes.Array,
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)
src\Compilers\Core\Portable\EncodedStringText.cs (1)
146return SourceText.From(bytes.Array,
Microsoft.CodeAnalysis.Features.UnitTests (1)
EditAndContinue\EditAndContinueWorkspaceServiceTests.cs (1)
69var sourceTreeC1 = SyntaxFactory.ParseSyntaxTree(SourceText.From(sourceBytesC1, sourceBytesC1.Length, encodingC, SourceHashAlgorithm.Sha1), TestOptions.Regular, sourceFileC.Path);
Microsoft.CodeAnalysis.UnitTests (12)
EmbeddedTextTests.cs (2)
42Assert.Throws<ArgumentException>("text", () => EmbeddedText.FromSource("path", SourceText.From(new byte[0], 0, Encoding.UTF8, canBeEmbedded: false))); 237SourceText.From(bytes, bytes.Length, Encoding.ASCII, SourceHashAlgorithm.Sha1, canBeEmbedded: true);
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)
src\Compilers\Core\Portable\EncodedStringText.cs (1)
146return SourceText.From(bytes.Array,