2745 references to UTF8
AnalyzerRunner (2)
aspire (1)
Aspire.Azure.Messaging.EventHubs.Tests (2)
Aspire.Azure.Security.KeyVault.Tests (2)
Aspire.Cli.Tests (1)
Aspire.Confluent.Kafka (2)
Aspire.Confluent.Kafka.Tests (2)
Aspire.Dashboard (8)
Aspire.Dashboard.Components.Tests (10)
Aspire.Dashboard.Tests (16)
Aspire.Hosting (10)
Aspire.Hosting.Azure (2)
Aspire.Hosting.Azure.EventHubs (2)
Aspire.Hosting.Azure.ServiceBus (2)
Aspire.Hosting.Azure.Tests (14)
Aspire.Hosting.Kubernetes (2)
Aspire.Hosting.PostgreSQL (1)
Aspire.Hosting.RabbitMQ.Tests (4)
Aspire.Hosting.Seq.Tests (1)
Aspire.Hosting.Tests (11)
Aspire.RabbitMQ.Client.Tests (1)
Aspire.RabbitMQ.Client.v7.Tests (1)
AzureFunctionsEndToEnd.ApiService (2)
BasicWebSite (2)
Benchmarks (2)
BinaryFormatTests (1)
Binding.Http.IntegrationTests (1)
BoundTreeGenerator (1)
BuildBoss (2)
BuildValidator (1)
Client.TypedClient.IntegrationTests (3)
ClientSample (2)
ConfigurationSchemaGenerator.Tests (1)
Contract.Service.IntegrationTests (2)
CorsMiddlewareWebSite (1)
csc (2)
CSharpErrorFactsGenerator (1)
CSharpSyntaxGenerator (2)
CustomAuthorizationFailureResponse (1)
dotnet-getdocument (1)
dotnet-razorpagegenerator (1)
dotnet-svcutil.xmlserializer (1)
dotnet-svcutil-lib (53)
FrameworkFork\System.Runtime.Serialization\System\Xml\XmlNodeWriter.cs (8)
35WriteStartElement(Encoding.UTF8.GetString(prefixBuffer, prefixOffset, prefixLength), Encoding.UTF8.GetString(localNameBuffer, localNameOffset, localNameLength));
50WriteEndElement(Encoding.UTF8.GetString(prefixBuffer, prefixOffset, prefixLength), Encoding.UTF8.GetString(localNameBuffer, localNameOffset, localNameLength));
55WriteXmlnsAttribute(Encoding.UTF8.GetString(prefixBuffer, prefixOffset, prefixLength), Encoding.UTF8.GetString(nsBuffer, nsOffset, nsLength));
61WriteStartAttribute(Encoding.UTF8.GetString(prefixBuffer, prefixOffset, prefixLength), Encoding.UTF8.GetString(localNameBuffer, localNameOffset, localNameLength));
dotnet-user-secrets (1)
Encoding.MessageVersion.IntegrationTests (7)
MessageVersionTests.cs (5)
30binding = new CustomBinding(new TextMessageEncodingBindingElement(MessageVersion.Soap12WSAddressingAugust2004, Encoding.UTF8), new HttpTransportBindingElement());
66binding = new CustomBinding(new TextMessageEncodingBindingElement(MessageVersion.Soap11WSAddressingAugust2004, Encoding.UTF8), new HttpTransportBindingElement());
102binding = new CustomBinding(new TextMessageEncodingBindingElement(MessageVersion.CreateVersion(EnvelopeVersion.Soap12, AddressingVersion.None), Encoding.UTF8), new HttpTransportBindingElement());
138binding = new CustomBinding(new TextMessageEncodingBindingElement(MessageVersion.CreateVersion(EnvelopeVersion.Soap11, AddressingVersion.WSAddressing10), Encoding.UTF8), new HttpTransportBindingElement());
174binding = new CustomBinding(new TextMessageEncodingBindingElement(MessageVersion.CreateVersion(EnvelopeVersion.Soap11, AddressingVersion.WSAddressing10), Encoding.UTF8), new TcpTransportBindingElement());
ExceptionHandlerSample (1)
Extensibility.MessageEncoder.IntegrationTests (2)
FilesWebSite (3)
FormatterWebSite (1)
GenerateDocumentationAndConfigFiles (9)
GetDocument.Insider (1)
http2cat (1)
HttpStress (1)
IdeCoreBenchmarks (1)
IdentitySample.PasskeyConformance (1)
IIS.FunctionalTests (7)
IIS.Microbenchmarks (1)
IISExpress.FunctionalTests (7)
illink (2)
Infrastructure.Common (2)
InMemory.FunctionalTests (47)
Http2\Http2StreamTests.cs (19)
193await SendDataAsync(1, Encoding.UTF8.GetBytes("Hello World"), endStream: true);
215Assert.Equal("Hello World", Encoding.UTF8.GetString(dataFrame.Payload.Span));
244await SendDataAsync(1, Encoding.UTF8.GetBytes("Hello World"), endStream: true);
266Assert.Equal("Hello World", Encoding.UTF8.GetString(dataFrame.Payload.Span));
2180_serviceContext.ServerOptions.ResponseHeaderEncodingSelector = _ => Encoding.UTF8;
2181_serviceContext.ServerOptions.RequestHeaderEncodingSelector = _ => Encoding.UTF8; // Used for decoding response.
2506_serviceContext.ServerOptions.ResponseHeaderEncodingSelector = _ => Encoding.UTF8;
2507_serviceContext.ServerOptions.RequestHeaderEncodingSelector = _ => Encoding.UTF8; // Used for decoding response.
4964Assert.Equal("Hello World", Encoding.UTF8.GetString(bodyFrame.Payload.Span));
5088Assert.Equal("Hello World", Encoding.UTF8.GetString(bodyFrame.Payload.Span));
5156var length = Encoding.UTF8.GetBytes("Hello World", buffer.Span);
5206Assert.Equal("Hello World", Encoding.UTF8.GetString(bodyFrame.Payload.Span));
5280Assert.Equal("Hello World", Encoding.UTF8.GetString(bodyFrame.Payload.Span));
5357Assert.Equal("Hello World", Encoding.UTF8.GetString(bodyFrame.Payload.Span));
5428Assert.Equal("Hello World", Encoding.UTF8.GetString(bodyFrame.Payload.Span));
5506Assert.Equal("Hello World", Encoding.UTF8.GetString(bodyFrame.Payload.Span));
5595Assert.Equal("Hello World", Encoding.UTF8.GetString(bodyFrame.Payload.Span));
5682Assert.Equal("Hello World", Encoding.UTF8.GetString(bodyFrame.Payload.Span));
5774Assert.Equal("Hello World", Encoding.UTF8.GetString(bodyFrame.Payload.Span));
Http3\Http3StreamTests.cs (22)
811Assert.Equal("hello,", Encoding.UTF8.GetString(response.Span));
814Assert.Equal(" world", Encoding.UTF8.GetString(secondResponse.Span));
891_serviceContext.ServerOptions.ResponseHeaderEncodingSelector = _ => Encoding.UTF8;
892_serviceContext.ServerOptions.RequestHeaderEncodingSelector = _ => Encoding.UTF8; // Used for decoding response.
1040_serviceContext.ServerOptions.ResponseHeaderEncodingSelector = _ => Encoding.UTF8;
1041_serviceContext.ServerOptions.RequestHeaderEncodingSelector = _ => Encoding.UTF8; // Used for decoding response.
1316Assert.Equal("Hello World", Encoding.UTF8.GetString(data.Span));
1419Assert.Equal("Hello World", Encoding.UTF8.GetString(data.Span));
1485var length = Encoding.UTF8.GetBytes("Hello World", buffer.Span);
1515Assert.Equal("Hello World", Encoding.UTF8.GetString(data.Span));
1570Assert.Equal("Hello World", Encoding.UTF8.GetString(data.Span));
1628Assert.Equal("Hello World", Encoding.UTF8.GetString(data.Span));
1686Assert.Equal("Hello World", Encoding.UTF8.GetString(data.Span));
1744Assert.Equal("Hello World", Encoding.UTF8.GetString(data.Span));
1808Assert.Equal("Hello World", Encoding.UTF8.GetString(data.Span));
1869Assert.Equal("Hello World", Encoding.UTF8.GetString(data.Span));
1937Assert.Equal("Hello World", Encoding.UTF8.GetString(data.Span));
1961await requestStream.SendDataAsync(Encoding.UTF8.GetBytes("This is invalid."));
1989await requestStream.SendDataAsync(Encoding.UTF8.GetBytes("Hello world"));
2023await requestStream.SendDataAsync(Encoding.UTF8.GetBytes("Hello world"));
2025await requestStream.SendDataAsync(Encoding.UTF8.GetBytes("This is invalid."));
2073await requestStream.SendDataAsync(Encoding.UTF8.GetBytes("Hello world"));
InProcessWebSite (8)
src\Servers\IIS\IIS\test\testassets\InProcessWebSite\Startup.cs (6)
635await ctx.Response.WriteAsync(Encoding.UTF8.GetString(readBuffer, 0, result));
648await ctx.Response.WriteAsync(Encoding.UTF8.GetString(readBuffer, 0, result));
741await ctx.Response.WriteAsync(Encoding.UTF8.GetString(readBuffer, 0, result));
743await ctx.Response.WriteAsync(Encoding.UTF8.GetString(readBuffer, 0, result));
778await ctx.Response.WriteAsync(Encoding.UTF8.GetString(buffer));
963await fileStream.WriteAsync(Encoding.UTF8.GetBytes(fileContent), 0, fileContent.Length);
Interop.FunctionalTests (10)
Http2WebSocketInteropTests.cs (4)
68Assert.Equal("Hello", Encoding.UTF8.GetString(bytes, 0, result.Count));
70await ws.SendAsync(Encoding.UTF8.GetBytes("Hi there"), WebSocketMessageType.Text, endOfMessage: true, default);
86await wsClient.SendAsync(Encoding.UTF8.GetBytes("Hello"), WebSocketMessageType.Text, endOfMessage: true, default);
92Assert.Equal("Hi there", Encoding.UTF8.GetString(bytes, 0, result.Count));
IOperationGenerator (2)
LargeResponseApp (1)
Metrics (9)
Metrics.Legacy (9)
Microsoft.Arcade.Common (2)
Microsoft.Arcade.Test.Common (1)
Microsoft.AspNetCore.Antiforgery (3)
Microsoft.AspNetCore.App.Analyzers.Test (1)
Microsoft.AspNetCore.Authentication.MicrosoftAccount (1)
Microsoft.AspNetCore.Authentication.Negotiate (2)
Microsoft.AspNetCore.Authentication.OAuth (1)
Microsoft.AspNetCore.Authentication.OpenIdConnect (5)
Microsoft.AspNetCore.Authentication.Test (29)
Microsoft.AspNetCore.Components (5)
Microsoft.AspNetCore.Components.Endpoints (11)
Microsoft.AspNetCore.Components.Endpoints.Tests (8)
Binding\FormDataMapperTests.cs (6)
2011var expected = new FormFileCollection { new FormFile(new MemoryStream(Encoding.UTF8.GetBytes(expectedString)), 0, expectedString.Length, "file", "file.txt") };
2031Assert.Equal(expectedString, Encoding.UTF8.GetString(buffer, 0, buffer.Length));
2042new FormFile(new MemoryStream(Encoding.UTF8.GetBytes(expectedString1)), 0, expectedString1.Length, "file", "file1.txt"),
2043new FormFile(new MemoryStream(Encoding.UTF8.GetBytes(expectedString2)), 0, expectedString2.Length, "file", "file2.txt")
2066Assert.Equal(expectedString1, Encoding.UTF8.GetString(buffer1, 0, buffer1.Length));
2073Assert.Equal(expectedString1, Encoding.UTF8.GetString(buffer2, 0, buffer2.Length));
Microsoft.AspNetCore.Components.Server (5)
Microsoft.AspNetCore.Components.Server.Tests (11)
Microsoft.AspNetCore.Components.Web.Tests (1)
Microsoft.AspNetCore.Components.WebAssembly.Server (5)
Microsoft.AspNetCore.Components.WebView (2)
Microsoft.AspNetCore.Components.WebView.Maui (1)
Microsoft.AspNetCore.Components.WebView.Test (1)
Microsoft.AspNetCore.Components.WebView.WindowsForms (1)
Microsoft.AspNetCore.Components.WebView.Wpf (1)
Microsoft.AspNetCore.Cryptography.Internal.Tests (2)
Microsoft.AspNetCore.Cryptography.KeyDerivation (5)
Microsoft.AspNetCore.Cryptography.KeyDerivation.Tests (3)
Microsoft.AspNetCore.DataProtection (1)
Microsoft.AspNetCore.DataProtection.Extensions.Tests (3)
Microsoft.AspNetCore.DataProtection.Tests (57)
Microsoft.AspNetCore.Diagnostics (1)
Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore (1)
Microsoft.AspNetCore.Diagnostics.HealthChecks (3)
Microsoft.AspNetCore.Diagnostics.Tests (1)
Microsoft.AspNetCore.Grpc.JsonTranscoding (6)
Microsoft.AspNetCore.Grpc.JsonTranscoding.Tests (20)
Microsoft.AspNetCore.Http (1)
Microsoft.AspNetCore.Http.Abstractions (2)
Microsoft.AspNetCore.Http.Abstractions.Tests (9)
Microsoft.AspNetCore.Http.Connections.Tests (57)
HttpConnectionDispatcherTests.cs (36)
70var negotiateResponse = JsonConvert.DeserializeObject<JObject>(Encoding.UTF8.GetString(ms.ToArray()));
95var negotiateResponse = JsonConvert.DeserializeObject<JObject>(Encoding.UTF8.GetString(ms.ToArray()));
122var negotiateResponse = JsonConvert.DeserializeObject<JObject>(Encoding.UTF8.GetString(ms.ToArray()));
159var negotiateResponse = JsonConvert.DeserializeObject<JObject>(Encoding.UTF8.GetString(ms.ToArray()));
187var negotiateResponse = JsonConvert.DeserializeObject<JObject>(Encoding.UTF8.GetString(ms.ToArray()));
215var bytes = Encoding.UTF8.GetBytes("EXTRADATA Hi");
245Assert.Equal("Hi", Encoding.UTF8.GetString(result.Buffer.ToArray()));
274var negotiateResponse = JsonConvert.DeserializeObject<JObject>(Encoding.UTF8.GetString(ms.ToArray()));
322Assert.Equal("No Connection with that ID", Encoding.UTF8.GetString(strm.ToArray()));
363Assert.Equal("No Connection with that ID", Encoding.UTF8.GetString(strm.ToArray()));
401Assert.Equal("POST requests are not allowed for WebSocket connections.", Encoding.UTF8.GetString(strm.ToArray()));
585var bytes = Encoding.UTF8.GetBytes("Hello World");
613Assert.Equal("Hello World", Encoding.UTF8.GetString(result.Buffer.ToArray()));
649var bytes = Encoding.UTF8.GetBytes("Hello World");
796var buffer = Encoding.UTF8.GetBytes("Hello World");
871Assert.Equal("Connection ID required", Encoding.UTF8.GetString(strm.ToArray()));
945Assert.Equal("Connection ID required", Encoding.UTF8.GetString(strm.ToArray()));
1655var buffer = Encoding.UTF8.GetBytes("Hello World");
1690var buffer = Encoding.UTF8.GetBytes("Hello World");
1731var buffer = Encoding.UTF8.GetBytes("Hello World");
1775await connection.Transport.Output.WriteAsync(Encoding.UTF8.GetBytes("Hello, World"));
1863await connection.Transport.Output.WriteAsync(Encoding.UTF8.GetBytes("Unblock")).AsTask().DefaultTimeout();
1915await connection.Transport.Output.WriteAsync(Encoding.UTF8.GetBytes("Unblock")).AsTask().DefaultTimeout();
2045Assert.Equal("Cannot terminate this connection using the DELETE endpoint.", Encoding.UTF8.GetString(ms.ToArray()));
2223await c.Transport.Output.WriteAsync(Encoding.UTF8.GetBytes("Message1")).DefaultTimeout();
2226await c.Transport.Output.WriteAsync(Encoding.UTF8.GetBytes("Message2")).DefaultTimeout();
2242Assert.Equal("Message1", Encoding.UTF8.GetString(ms.ToArray()));
2252Assert.Equal("Message2", Encoding.UTF8.GetString(ms.ToArray()));
2276var negotiateResponse = JsonConvert.DeserializeObject<JObject>(Encoding.UTF8.GetString(ms.ToArray()));
2302var negotiateResponse = JsonConvert.DeserializeObject<JObject>(Encoding.UTF8.GetString(ms.ToArray()));
2331var negotiateResponse = JsonConvert.DeserializeObject<JObject>(Encoding.UTF8.GetString(ms.ToArray()));
2360var negotiateResponse = JsonConvert.DeserializeObject<JObject>(Encoding.UTF8.GetString(ms.ToArray()));
2575var buffer = Encoding.UTF8.GetBytes("Hello, world");
2635var buffer = Encoding.UTF8.GetBytes("Hello, world");
2692var buffer = Encoding.UTF8.GetBytes("Hello, world");
3723Assert.Equal($"{transportType} transport not supported by this end point type", Encoding.UTF8.GetString(strm.ToArray()));
Microsoft.AspNetCore.Http.Extensions (5)
Microsoft.AspNetCore.Http.Extensions.Tests (64)
RequestDelegateGenerator\CompileTimeCreationTests.cs (10)
56project = project.AddDocument("TestMapActions.cs", SourceText.From(source, Encoding.UTF8)).Project;
57project = project.AddDocument("OtherTestMapActions.cs", SourceText.From(otherSource, Encoding.UTF8)).Project;
82project = project.AddDocument("TestMapActions.cs", SourceText.From(source, Encoding.UTF8)).Project;
83project = project.AddDocument("OtherTestMapActions.cs", SourceText.From(otherSource, Encoding.UTF8)).Project;
165project = project.AddDocument("TestMapActions.cs", SourceText.From(source, Encoding.UTF8), filePath: Path.Combine(currentDirectory, "TestMapActions.cs")).Project;
232project = project.AddDocument("TestMapActions.cs", SourceText.From(source, Encoding.UTF8)).Project;
286project = project.AddDocument("TestMapActions.cs", SourceText.From(source, Encoding.UTF8)).Project;
333project = project.AddDocument("TestMapActions.cs", SourceText.From(source, Encoding.UTF8)).Project;
669project = project.AddDocument("TestMapActions.cs", SourceText.From(source, Encoding.UTF8)).Project;
726project = project.AddDocument("TestMapActions.cs", SourceText.From(source, Encoding.UTF8)).Project;
RequestDelegateGenerator\RequestDelegateCreationTests.Forms.cs (16)
25var fileContent = new StringContent("hello", Encoding.UTF8, "application/octet-stream");
60var fileContent = new StringContent("hello", Encoding.UTF8, "application/octet-stream");
95var fileContent = new StringContent("hello", Encoding.UTF8, "application/octet-stream");
133var fileContent = new StringContent("hello", Encoding.UTF8, "application/octet-stream");
169var fileContent1 = new StringContent("hello", Encoding.UTF8, "application/octet-stream");
170var fileContent2 = new StringContent("there", Encoding.UTF8, "application/octet-stream");
212var fileContent = new StringContent("hello", Encoding.UTF8, "application/octet-stream");
249var fileContent = new StringContent("hello", Encoding.UTF8, "application/octet-stream");
285var fileContent = new StringContent("hello", Encoding.UTF8, "application/octet-stream");
358var fileContent = new StringContent("hello", Encoding.UTF8, "application/octet-stream");
392var fileContent = new StringContent("hello", Encoding.UTF8, "application/octet-stream");
441var fileContent = new StringContent("hello", Encoding.UTF8, "application/octet-stream");
481var fileContent = new StringContent("hello", Encoding.UTF8, "application/octet-stream");
818var fileContent = new StringContent("hello", Encoding.UTF8, "application/octet-stream");
964httpContext.Request.Body = new MemoryStream(Encoding.UTF8.GetBytes(new string('x', 2049)));
1001httpContext.Request.Body = new MemoryStream(Encoding.UTF8.GetBytes(new string('x', 2049)));
Microsoft.AspNetCore.Http.Microbenchmarks (3)
Microsoft.AspNetCore.Http.Results (1)
Microsoft.AspNetCore.Http.Results.Tests (31)
Microsoft.AspNetCore.Http.Tests (26)
Microsoft.AspNetCore.HttpLogging (7)
Microsoft.AspNetCore.HttpLogging.Tests (11)
Microsoft.AspNetCore.Identity (7)
Microsoft.AspNetCore.Identity.EntityFrameworkCore.Test (1)
Microsoft.AspNetCore.Identity.InMemory.Test (2)
Microsoft.AspNetCore.Identity.Test (7)
Microsoft.AspNetCore.Identity.UI (20)
Microsoft.AspNetCore.Mvc.Core (16)
Microsoft.AspNetCore.Mvc.Core.Test (74)
Microsoft.AspNetCore.Mvc.Formatters.Xml (2)
Microsoft.AspNetCore.Mvc.Formatters.Xml.Test (54)
Microsoft.AspNetCore.Mvc.FunctionalTests (48)
ConsumesAttributeTestsBase.cs (5)
102request.Content = new StringContent(input, Encoding.UTF8, requestContentType);
123request.Content = new StringContent(input, Encoding.UTF8, requestContentType);
147request.Content = new StringContent(input, Encoding.UTF8, "application/xml");
168request.Content = new StringContent(input, Encoding.UTF8, "application/vnd.example+json");
191request.Content = new StringContent(input, Encoding.UTF8, "application/vnd.example+xml");
InputObjectValidationTests.cs (12)
75var content = new StringContent(input, Encoding.UTF8, "application/xml");
97var content = new StringContent(input, Encoding.UTF8, "application/json");
118var content = new StringContent("{\"Alias\":\"xyz\"}", Encoding.UTF8, "application/json");
134var content = new StringContent(requestData, Encoding.UTF8, "application/json");
164var content = new StringContent(requestContent, Encoding.UTF8, "application/json");
204var content = new StringContent(invalidRequestData, Encoding.UTF8, "application/json");
225var content = new StringContent(invalidRequestData, Encoding.UTF8, "application/json");
245var content = new StringContent(invalidRequestData, Encoding.UTF8, "application/json");
270Content = new StringContent(@"{ ""Id"": ""S-1-5-21-1004336348-1177238915-682003330-512"" }", Encoding.UTF8, "application/json"),
291Content = new StringContent(input, Encoding.UTF8, "application/json"),
320Content = new StringContent(input, Encoding.UTF8, "application/json"),
352Content = new StringContent(input, Encoding.UTF8, "application/xml"),
JsonInputFormatterTestBase.cs (6)
47var content = new StringContent(input, Encoding.UTF8, requestContentType);
66var content = new StringContent(jsonInput, Encoding.UTF8, requestContentType);
84var content = new StringContent(input, Encoding.UTF8, "application/json");
100var content = new StringContent(expected, Encoding.UTF8, "application/json");
203var content = new StringContent(jsonInput, Encoding.UTF8, "application/json");
222var content = new StringContent(jsonInput, Encoding.UTF8, requestContentType);
Microsoft.AspNetCore.Mvc.IntegrationTests (41)
Microsoft.AspNetCore.Mvc.NewtonsoftJson (3)
Microsoft.AspNetCore.Mvc.NewtonsoftJson.Test (75)
NewtonsoftJsonOutputFormatterTest.cs (19)
80await jsonFormatter.WriteResponseBodyAsync(outputFormatterContext, Encoding.UTF8);
112await jsonFormatter.WriteResponseBodyAsync(outputFormatterContext, Encoding.UTF8);
136await jsonFormatter.WriteResponseBodyAsync(outputFormatterContext, Encoding.UTF8);
144var content = new StreamReader(body, Encoding.UTF8).ReadToEnd();
159await jsonFormatter.WriteResponseBodyAsync(outputFormatterContext1, Encoding.UTF8);
168await jsonFormatter.WriteResponseBodyAsync(outputFormatterContext2, Encoding.UTF8);
176var content = new StreamReader(body, Encoding.UTF8).ReadToEnd();
211await formatter.WriteResponseBodyAsync(context, Encoding.UTF8);
219var content = new StreamReader(body, Encoding.UTF8).ReadToEnd();
263await formatter.WriteResponseBodyAsync(context, Encoding.UTF8);
271var content = new StreamReader(body, Encoding.UTF8).ReadToEnd();
299await formatter.WriteResponseBodyAsync(context, Encoding.UTF8);
307var content = new StreamReader(body, Encoding.UTF8).ReadToEnd();
334await formatter.WriteResponseBodyAsync(context, Encoding.UTF8);
342var content = new StreamReader(body, Encoding.UTF8).ReadToEnd();
360await formatter.WriteResponseBodyAsync(outputFormatterContext, Encoding.UTF8);
390await formatter.WriteResponseBodyAsync(outputFormatterContext, Encoding.UTF8);
421await formatter.WriteResponseBodyAsync(context, Encoding.UTF8);
429var content = new StreamReader(body, Encoding.UTF8).ReadToEnd();
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (1)
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.Test (2)
Microsoft.AspNetCore.Mvc.Razor.Test (2)
Microsoft.AspNetCore.Mvc.RazorPages.Test (4)
Microsoft.AspNetCore.Mvc.TagHelpers (5)
Microsoft.AspNetCore.Mvc.TagHelpers.Test (11)
Microsoft.AspNetCore.Mvc.Testing.Tasks (1)
Microsoft.AspNetCore.Mvc.ViewFeatures (3)
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (17)
Microsoft.AspNetCore.Mvc.Views.TestCommon (4)
Microsoft.AspNetCore.OpenApi.SourceGenerators.Tests (3)
Microsoft.AspNetCore.OpenApi.Tests (5)
Microsoft.AspNetCore.OutputCaching (4)
Microsoft.AspNetCore.OutputCaching.StackExchangeRedis (3)
Microsoft.AspNetCore.OutputCaching.Tests (5)
Microsoft.AspNetCore.Owin (1)
Microsoft.AspNetCore.Razor (1)
Microsoft.AspNetCore.RequestDecompression.Tests (1)
Microsoft.AspNetCore.ResponseCaching.Tests (1)
Microsoft.AspNetCore.Rewrite (1)
Microsoft.AspNetCore.Routing (1)
Microsoft.AspNetCore.Routing.Tests (7)
Microsoft.AspNetCore.Server.HttpSys (4)
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (14)
Listener\RequestHeaderTests.cs (4)
25Task responseTask = SendRequestAsync(address, "Custom-Header", customValues, Encoding.UTF8);
66Task responseTask = SendRequestAsync(address, "Custom-Header", customValues, Encoding.UTF8);
162Task responseTask = SendRequestAsync(address, "If-None-Match", customValues, Encoding.UTF8);
187Task responseTask = SendRequestAsync(address, "Custom-Header", customValues, Encoding.UTF8);
Microsoft.AspNetCore.Server.IIS (6)
Microsoft.AspNetCore.Server.Kestrel.Core (5)
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (16)
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (5)
Microsoft.AspNetCore.Server.Kestrel.Transport.NamedPipes (2)
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (2)
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Tests (4)
Microsoft.AspNetCore.Session (4)
Microsoft.AspNetCore.Shared.Tests (11)
Microsoft.AspNetCore.SignalR.Client.FunctionalTests (2)
Microsoft.AspNetCore.SignalR.Client.SourceGenerator (4)
Microsoft.AspNetCore.SignalR.Client.Tests (19)
Microsoft.AspNetCore.SignalR.Common (2)
Microsoft.AspNetCore.SignalR.Common.Tests (63)
Microsoft.AspNetCore.SignalR.Core (3)
Microsoft.AspNetCore.SignalR.Microbenchmarks (16)
Microsoft.AspNetCore.SignalR.Protocols.Json (1)
Microsoft.AspNetCore.SignalR.Protocols.MessagePack (1)
Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson (2)
Microsoft.AspNetCore.SignalR.StackExchangeRedis (1)
Microsoft.AspNetCore.SignalR.StackExchangeRedis.Tests (1)
Microsoft.AspNetCore.SignalR.Tests (38)
HubConnectionHandlerTests.cs (17)
339var part1 = Encoding.UTF8.GetBytes("{\"protocol\": \"json\"");
340var part2 = Encoding.UTF8.GetBytes(",\"version\": 1}");
341var part3 = Encoding.UTF8.GetBytes("\u001e");
382var part1 = Encoding.UTF8.GetBytes("{\"type\":1, \"invocationId\":\"1\", ");
383var part2 = Encoding.UTF8.GetBytes("\"target\": \"Echo\", \"arguments\"");
384var part3 = Encoding.UTF8.GetBytes(":[\"hello\"]}\u001e");
423var payload = Encoding.UTF8.GetBytes("{\"protocol\": \"json\",\"version\": 1}\u001e{\"type\":1, \"invocationId\":\"1\", \"target\": \"Echo\", \"arguments\":[\"hello\"]}\u001e");
479var payload = Encoding.UTF8.GetBytes("{\"type\":1, \"invocationId\":\"1\", \"target\": \"Echo\", \"arguments\":[\"hello\"]}\u001e");
508var payload = Encoding.UTF8.GetBytes("{\"type\":1, \"invocationId\":\"1\", \"target\": \"Echo\", \"arguments\":[\"hello\"]}\u001e");
538var payload1 = Encoding.UTF8.GetBytes("{\"type\":1, \"invocationId\":\"1\", \"target\": \"Echo\", \"arguments\":[\"one\"]}\u001e");
539var payload2 = Encoding.UTF8.GetBytes("{\"type\":1, \"invocationId\":\"2\", \"target\": \"Echo\", \"arguments\":[\"two\"]}\u001e");
540var payload3 = Encoding.UTF8.GetBytes("{\"type\":1, \"invocationId\":\"3\", \"target\": \"Echo\", \"arguments\":[\"three\"]}\u001e");
589var payload1 = Encoding.UTF8.GetBytes("{\"type\":1, \"invocationId\":\"1\", \"target\": \"Echo\", \"arguments\":[\"one\"]}\u001e");
590var payload2 = Encoding.UTF8.GetBytes("{\"type\":1, \"invocationId\":\"2\", \"target\": \"Echo\", \"arguments\":[\"two\"]}\u001e");
591var payload3 = Encoding.UTF8.GetBytes("{\"type\":1, \"invocationId\":\"3\", \"target\": \"Echo\", \"arguments\":[\"three\"]}\u001e");
668var payload = Encoding.UTF8.GetBytes("{\"protocol\": \"json\",\"ver");
3566await client.Connection.Application.Output.WriteAsync(Encoding.UTF8.GetBytes(new[] { '{' })).DefaultTimeout();
Microsoft.AspNetCore.SpaProxy (1)
Microsoft.AspNetCore.StaticAssets.Tests (1)
Microsoft.AspNetCore.StaticFiles (1)
Microsoft.AspNetCore.TestHost.Tests (15)
TestClientTests.cs (11)
219Assert.Equal("STARTED", Encoding.UTF8.GetString(buffer, 0, length));
222await requestStream.WriteAsync(Encoding.UTF8.GetBytes("Hello world")).AsTask().DefaultTimeout();
228Assert.Equal("Hello world POST Response", Encoding.UTF8.GetString(buffer, 0, length));
282Assert.Equal("SENT", Encoding.UTF8.GetString(serverBuffer, 0, serverLength));
326await requestStream.WriteAsync(Encoding.UTF8.GetBytes("SENT")).AsTask().DefaultTimeout();
379Assert.Equal("POST Response", Encoding.UTF8.GetString(buffer, 0, length));
386await requestStream.WriteAsync(Encoding.UTF8.GetBytes(new string('!', 1024 * 1024 * 50))).AsTask().DefaultTimeout();
544() => requestStream.WriteAsync(Encoding.UTF8.GetBytes("Hello world")).AsTask(),
616var hello = Encoding.UTF8.GetBytes("hello");
618var world = Encoding.UTF8.GetBytes("world!");
808var hello = Encoding.UTF8.GetBytes("hello");
Microsoft.AspNetCore.Tests (1)
Microsoft.AspNetCore.WebSockets (1)
Microsoft.AspNetCore.WebSockets.Tests (12)
Microsoft.AspNetCore.WebUtilities (9)
Microsoft.AspNetCore.WebUtilities.Microbenchmarks (8)
Microsoft.AspNetCore.WebUtilities.Tests (89)
FormPipeReaderTests.cs (29)
114Assert.Equal(Encoding.UTF8.GetBytes(content), readResult.Buffer.ToArray());
129Assert.Equal(Encoding.UTF8.GetBytes(content), readResult.Buffer.ToArray());
157Assert.Equal(Encoding.UTF8.GetBytes(content), readResult.Buffer.ToArray());
185Assert.Equal(Encoding.UTF8.GetBytes(content), readResult.Buffer.ToArray());
196await bodyPipe.Writer.WriteAsync(Encoding.UTF8.GetBytes(content1));
202await bodyPipe.Writer.WriteAsync(Encoding.UTF8.GetBytes(content2));
210Assert.Equal(Encoding.UTF8.GetBytes("baz=12345678901"), readResult.Buffer.ToArray());
431var readOnlySequence = ReadOnlySequenceFactory.CreateSegments(Encoding.UTF8.GetBytes("foo=bar&"), Encoding.UTF8.GetBytes("baz=boo"));
448var readOnlySequence = ReadOnlySequenceFactory.SingleSegmentFactory.CreateWithContent(Encoding.UTF8.GetBytes("foo=bar&baz=boo&t="));
462var readOnlySequence = ReadOnlySequenceFactory.CreateSegments(Encoding.UTF8.GetBytes("fo=bar&ba"), Encoding.UTF8.GetBytes("z=boo&t="));
476var readOnlySequence = ReadOnlySequenceFactory.CreateSegments(Encoding.UTF8.GetBytes("foo=bar&baz=boo&t="));
490var readOnlySequence = ReadOnlySequenceFactory.CreateSegments(Encoding.UTF8.GetBytes("foo=ba&baz=bo"), Encoding.UTF8.GetBytes("o&t="));
504var readOnlySequence = ReadOnlySequenceFactory.CreateSegments(Encoding.UTF8.GetBytes("foo=ba&baz=bo"), Encoding.UTF8.GetBytes("o&asdfasdfasd="));
518var readOnlySequence = ReadOnlySequenceFactory.CreateSegments(Encoding.UTF8.GetBytes("foo=ba&baz=bo"), Encoding.UTF8.GetBytes("o&t=asdfasdfasd"));
534var bytes = Encoding.UTF8.GetBytes("foo=bar&baz=boo");
602{ ReadOnlySequenceFactory.CreateSegments(Encoding.UTF8.GetBytes("fo=bar&b"), Encoding.UTF8.GetBytes("a")) },
603{ new ReadOnlySequence<byte>(Encoding.UTF8.GetBytes("fo=bar&ba")) }
609{ ReadOnlySequenceFactory.CreateSegments(Encoding.UTF8.GetBytes("fo=bar&b"), Encoding.UTF8.GetBytes("=")) },
610{ new ReadOnlySequence<byte>(Encoding.UTF8.GetBytes("fo=bar&b=")) }
616{ Encoding.UTF8 },
629var formContent = Encoding.UTF8.GetBytes(text);
648return Encoding.UTF8.GetBytes(keyValue);
HttpRequestStreamReaderTest.cs (16)
45var reader = new HttpRequestStreamReader(GetLargeStream(), Encoding.UTF8);
57var reader = new HttpRequestStreamReader(stream, Encoding.UTF8);
102var reader = new HttpRequestStreamReader(new MemoryStream(), Encoding.UTF8);
198var reader = new HttpRequestStreamReader(stream, Encoding.UTF8);
222var reader = new HttpRequestStreamReader(stream, Encoding.UTF8, 10);
241var reader = new HttpRequestStreamReader(stream, Encoding.UTF8);
259var reader = new HttpRequestStreamReader(stream, Encoding.UTF8);
359var httpRequestStreamReader = new HttpRequestStreamReader(new MemoryStream(), Encoding.UTF8, size, ArrayPool<byte>.Shared, ArrayPool<char>.Shared);
370var httpRequestStreamReader = new HttpRequestStreamReader(mockStream.Object, Encoding.UTF8, 1, ArrayPool<byte>.Shared, ArrayPool<char>.Shared);
378var httpRequestStreamReader = new HttpRequestStreamReader(new MemoryStream(), Encoding.UTF8, 10, ArrayPool<byte>.Shared, ArrayPool<char>.Shared);
391var httpRequestStreamReader = new HttpRequestStreamReader(new MemoryStream(), Encoding.UTF8, 10, ArrayPool<byte>.Shared, ArrayPool<char>.Shared);
400return new HttpRequestStreamReader(stream, Encoding.UTF8);
406return new HttpRequestStreamReader(stream, Encoding.UTF8, bufferSize);
441yield return new object?[] { null, Encoding.UTF8, ArrayPool<byte>.Shared, ArrayPool<char>.Shared };
443yield return new object?[] { new MemoryStream(), Encoding.UTF8, null, ArrayPool<char>.Shared };
444yield return new object?[] { new MemoryStream(), Encoding.UTF8, ArrayPool<byte>.Shared, null };
HttpResponseStreamWriterTest.cs (33)
38var writer = new HttpResponseStreamWriter(stream, Encoding.UTF8);
54var writer = new HttpResponseStreamWriter(stream, Encoding.UTF8);
73var writer = new HttpResponseStreamWriter(stream, Encoding.UTF8);
94var writer = new HttpResponseStreamWriter(stream, Encoding.UTF8);
111var writer = new HttpResponseStreamWriter(stream, Encoding.UTF8);
130var writer = new HttpResponseStreamWriter(stream, Encoding.UTF8);
149var writer = new HttpResponseStreamWriter(stream, Encoding.UTF8);
168var writer = new HttpResponseStreamWriter(stream, Encoding.UTF8);
189var writer = new HttpResponseStreamWriter(stream, Encoding.UTF8);
214var writer = new HttpResponseStreamWriter(stream, Encoding.UTF8);
238var writer = new HttpResponseStreamWriter(stream, Encoding.UTF8);
260var writer = new HttpResponseStreamWriter(stream, Encoding.UTF8);
293var writer = new HttpResponseStreamWriter(stream, Encoding.UTF8);
317var writer = new HttpResponseStreamWriter(stream, Encoding.UTF8);
341var writer = new HttpResponseStreamWriter(stream, Encoding.UTF8);
364var writer = new HttpResponseStreamWriter(stream, Encoding.UTF8);
383using var writer = new HttpResponseStreamWriter(stream, Encoding.UTF8);
419var writer = new HttpResponseStreamWriter(stream, Encoding.UTF8);
439var writer = new HttpResponseStreamWriter(stream, Encoding.UTF8);
479var writer = new HttpResponseStreamWriter(stream, Encoding.UTF8);
501var writer = new HttpResponseStreamWriter(stream, Encoding.UTF8);
523var writer = new HttpResponseStreamWriter(stream, Encoding.UTF8);
547var writer = new HttpResponseStreamWriter(stream, Encoding.UTF8);
586var writer = new HttpResponseStreamWriter(stream, Encoding.UTF8);
608var writer = new HttpResponseStreamWriter(stream, Encoding.UTF8);
686var encoding = Encoding.UTF8;
747var httpRequestStreamReader = new HttpRequestStreamReader(new MemoryStream(), Encoding.UTF8, size, ArrayPool<byte>.Shared, ArrayPool<char>.Shared);
758var httpRequestStreamReader = new HttpRequestStreamReader(mockStream.Object, Encoding.UTF8, 1, ArrayPool<byte>.Shared, ArrayPool<char>.Shared);
766var httpResponseStreamWriter = new HttpResponseStreamWriter(new MemoryStream(), Encoding.UTF8, 10, ArrayPool<byte>.Shared, ArrayPool<char>.Shared);
779var httpResponseStreamWriter = new HttpResponseStreamWriter(new MemoryStream(), Encoding.UTF8, 10, ArrayPool<byte>.Shared, ArrayPool<char>.Shared);
848yield return new object?[] { null, Encoding.UTF8, ArrayPool<byte>.Shared, ArrayPool<char>.Shared };
850yield return new object?[] { new MemoryStream(), Encoding.UTF8, null, ArrayPool<char>.Shared };
851yield return new object?[] { new MemoryStream(), Encoding.UTF8, ArrayPool<byte>.Shared, null };
Microsoft.Build.Framework (5)
Microsoft.Build.Tasks.CodeAnalysis (3)
Microsoft.Build.Tasks.CodeAnalysis.Sdk (3)
Microsoft.CodeAnalysis (22)
Microsoft.CodeAnalysis.Analyzers (8)
Microsoft.CodeAnalysis.AnalyzerUtilities (8)
Microsoft.CodeAnalysis.BannedApiAnalyzers (8)
Microsoft.CodeAnalysis.CodeStyle (7)
Microsoft.CodeAnalysis.CodeStyle.UnitTestUtilities (2)
Microsoft.CodeAnalysis.Compiler.Test.Resources (1)
Microsoft.CodeAnalysis.CSharp (2)
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (8)
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (31)
PdbSourceDocument\ImplementationAssemblyLookupServiceTests.cs (17)
42var sourceText = SourceText.From(metadataSource, encoding: Encoding.UTF8);
80var sourceText = SourceText.From(metadataSource, encoding: Encoding.UTF8);
122var sourceText = SourceText.From(metadataSource, encoding: Encoding.UTF8);
160var sourceText = SourceText.From(metadataSource, Encoding.UTF8);
184sourceText = SourceText.From(typeForwardSource, Encoding.UTF8);
221var sourceText = SourceText.From(metadataSource, encoding: Encoding.UTF8);
244sourceText = SourceText.From(typeForwardSource, Encoding.UTF8);
282var sourceText = SourceText.From(metadataSource, encoding: Encoding.UTF8);
305sourceText = SourceText.From(typeForwardSource, Encoding.UTF8);
337var sourceText = SourceText.From(metadataSource, encoding: Encoding.UTF8);
360sourceText = SourceText.From(typeForwardSource, Encoding.UTF8);
388var sourceText = SourceText.From(metadataSource, encoding: Encoding.UTF8);
411sourceText = SourceText.From(typeForwardSource, Encoding.UTF8);
453var sourceText = SourceText.From(metadataSource, encoding: Encoding.UTF8);
476sourceText = SourceText.From(typeForwardSource, Encoding.UTF8);
511var sourceText = SourceText.From(metadataSource, encoding: Encoding.UTF8);
534var typeForwardSourceText = SourceText.From(typeForwardSource, Encoding.UTF8);
PdbSourceDocument\PdbSourceDocumentLoaderServiceTests.cs (2)
48var result = await service.LoadSourceDocumentAsync(path, sourceDocument, Encoding.UTF8, new TelemetryMessage(CancellationToken.None), useExtendedTimeout: false, CancellationToken.None);
80var result = await service.LoadSourceDocumentAsync(path, sourceDocument, Encoding.UTF8, new TelemetryMessage(CancellationToken.None), useExtendedTimeout: false, CancellationToken.None);
PdbSourceDocument\PdbSourceDocumentTests.cs (10)
408var sourceText = SourceText.From(metadataSource, encoding: Encoding.UTF8);
438var sourceText = SourceText.From(metadataSource, encoding: Encoding.UTF8);
474var sourceText = SourceText.From(metadataSource, Encoding.UTF8);
521var sourceText = SourceText.From(metadataSource, Encoding.UTF8);
547sourceText = SourceText.From(typeForwardSource, Encoding.UTF8);
724CompileTestSource(path, SourceText.From(source2, Encoding.UTF8), project, Location.OnDisk, Location.OnDisk, buildReferenceAssembly: false, windowsPdb: false);
757File.WriteAllText(GetSourceFilePath(path), source2, Encoding.UTF8);
875var sourceText = SourceText.From(source, Encoding.UTF8);
926var sourceText1 = SourceText.From(source1, Encoding.UTF8);
927var sourceText2 = SourceText.From(source2, Encoding.UTF8);
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (6)
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (16)
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (18)
Attributes\AttributeTests_CallerInfoAttributes.cs (15)
4169SyntaxFactory.ParseSyntaxTree(source1, path: @"C:\filename", encoding: Encoding.UTF8),
4170SyntaxFactory.ParseSyntaxTree(source2, path: @"a\b\..\c\d", encoding: Encoding.UTF8),
4171SyntaxFactory.ParseSyntaxTree(source3, path: @"*", encoding: Encoding.UTF8),
4172SyntaxFactory.ParseSyntaxTree(source4, path: @" ", encoding: Encoding.UTF8),
4211SyntaxFactory.ParseSyntaxTree(source1, options: TestOptions.Regular9, path: @"C:\filename", encoding: Encoding.UTF8)
4264SyntaxFactory.ParseSyntaxTree(source1, path: @"C:\filename", encoding: Encoding.UTF8),
4265SyntaxFactory.ParseSyntaxTree(source2, path: @"a\b\..\c\d.cs", encoding: Encoding.UTF8),
4266SyntaxFactory.ParseSyntaxTree(source3, path: @"*", encoding: Encoding.UTF8),
4267SyntaxFactory.ParseSyntaxTree(source4, path: @"C:\x.cs", encoding: Encoding.UTF8),
4268SyntaxFactory.ParseSyntaxTree(source5, path: @"C:\x.cs", encoding: Encoding.UTF8),
5171new[] { SyntaxFactory.ParseSyntaxTree(source, path: @"C:\filename", encoding: Encoding.UTF8) },
5222new[] { SyntaxFactory.ParseSyntaxTree(source, options: TestOptions.Regular7, path: @"C:\filename", encoding: Encoding.UTF8) },
5555new[] { SyntaxFactory.ParseSyntaxTree(source, path: @"C:\filename", encoding: Encoding.UTF8) },
5615new[] { SyntaxFactory.ParseSyntaxTree(source, path: @"C:\filename", encoding: Encoding.UTF8) },
5670new[] { SyntaxFactory.ParseSyntaxTree(csSource, path: @"C:\filename", encoding: Encoding.UTF8) },
Attributes\AttributeTests_MarshalAs.cs (2)
1039{ "CustomMarshaler6", new byte[] { 0x2c, 0x00, 0x00, 0x60 }.Append(Encoding.UTF8.GetBytes("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\0")) },
1041{ "CustomMarshaler8", new byte[] { 0x2c, 0x00, 0x00, 0x59 }.Append(Encoding.UTF8.GetBytes("System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\0")) },
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests (10)
ScriptTests.cs (10)
48var script = CSharpScript.Create(new MemoryStream(Encoding.UTF8.GetBytes("1 + 2")), ScriptOptions);
144var script = CSharpScript.Create(new MemoryStream(Encoding.UTF8.GetBytes("1 + 2")), ScriptOptions);
861var opts = ScriptOptions.WithEmitDebugInformation(true).WithFilePath("debug.csx").WithFileEncoding(Encoding.UTF8);
875var opts = ScriptOptions.WithEmitDebugInformation(false).WithFilePath("debug.csx").WithFileEncoding(Encoding.UTF8);
884return VerifyStackTraceAsync(() => CSharpScript.Create(new MemoryStream(Encoding.UTF8.GetBytes("throw new System.Exception();")), opts), line: 1, column: 1, filename: "debug.csx");
891return VerifyStackTraceAsync(() => CSharpScript.Create(new MemoryStream(Encoding.UTF8.GetBytes("throw new System.Exception();")), opts));
906var opts = ScriptOptions.WithEmitDebugInformation(true).WithFileEncoding(Encoding.UTF8);
920var opts = ScriptOptions.WithEmitDebugInformation(false).WithFileEncoding(Encoding.UTF8);
929return VerifyStackTraceAsync(() => CSharpScript.Create(new MemoryStream(Encoding.UTF8.GetBytes("throw new System.Exception();")), opts), line: 1, column: 1, filename: "");
936return VerifyStackTraceAsync(() => CSharpScript.Create(new MemoryStream(Encoding.UTF8.GetBytes("throw new System.Exception();")), opts));
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (34)
SourceGeneration\AdditionalSourcesCollectionTests.cs (18)
54asc.Add(hintName, SourceText.From("public class D{}", Encoding.UTF8));
70asc.Add(hintName, SourceText.From("public class D{}", Encoding.UTF8));
110var exception = Assert.Throws<ArgumentException>(nameof(hintName), () => asc.Add(hintName, SourceText.From("public class D{}", Encoding.UTF8)));
120asc.Add("file3.cs", SourceText.From("", Encoding.UTF8));
121asc.Add("file1.cs", SourceText.From("", Encoding.UTF8));
122asc.Add("file2.cs", SourceText.From("", Encoding.UTF8));
123asc.Add("file5.cs", SourceText.From("", Encoding.UTF8));
124asc.Add("file4.cs", SourceText.From("", Encoding.UTF8));
144asc.Add(names[i], SourceText.From("", Encoding.UTF8));
166asc.Add(hintName1, SourceText.From("", Encoding.UTF8));
167var exception = Assert.Throws<ArgumentException>("hintName", () => asc.Add(hintName2, SourceText.From("", Encoding.UTF8)));
176asc.Add("hintName1", SourceText.From("", Encoding.UTF8));
177asc.Add("hintName2", SourceText.From("", Encoding.UTF8));
180asc2.Add("hintName3", SourceText.From("", Encoding.UTF8));
181asc2.Add("hintName1", SourceText.From("", Encoding.UTF8));
200asc.Add(addHintName, SourceText.From("", Encoding.UTF8));
212asc.Add(addHintName, SourceText.From("", Encoding.UTF8));
224asc.Add("file1.cs", SourceText.From("", Encoding.UTF8));
SourceGeneration\GeneratorDriverTests.cs (11)
460sgc.AddSource("test", SourceText.From("public class D{}", Encoding.UTF8));
463Assert.Throws<ArgumentException>("hintName", () => sgc.AddSource("test", SourceText.From("public class D{}", Encoding.UTF8)));
466Assert.Throws<ArgumentException>("hintName", () => sgc.AddSource("test.cs", SourceText.From("public class D{}", Encoding.UTF8)));
491spc.AddSource("test", SourceText.From("public class D{}", Encoding.UTF8));
494Assert.Throws<ArgumentException>("hintName", () => spc.AddSource("test", SourceText.From("public class D{}", Encoding.UTF8)));
497Assert.Throws<ArgumentException>("hintName", () => spc.AddSource("test.cs", SourceText.From("public class D{}", Encoding.UTF8)));
504spc.AddSource("test", SourceText.From("public class D{}", Encoding.UTF8));
586var generator = new CallbackGenerator((ic) => { }, (sgc) => { sgc.AddSource("test", SourceText.From("public class D {}", Encoding.UTF8)); });
616var generator = new CallbackGenerator((ic) => { }, (sgc) => { sgc.AddSource("test", SourceText.From("public class D {}", Encoding.UTF8)); sgc.AddSource("test2", SourceText.From("public class E {}", Encoding.UTF8)); });
756e.AddSource("a", SourceText.From("public class E {}", Encoding.UTF8));
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (4)
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (4)
Syntax\SyntaxTreeTests.cs (3)
86SyntaxTreeFactoryKind.ParseText => CSharpSyntaxTree.ParseText(SourceText.From(source, Encoding.UTF8, SourceHashAlgorithm.Sha256), parseOptions),
87SyntaxTreeFactoryKind.Subclass => new MockCSharpSyntaxTree(root, SourceText.From(source, Encoding.UTF8, SourceHashAlgorithm.Sha256), parseOptions),
89SyntaxTreeFactoryKind.ParsedTreeWithPath => WithInitializedDirectives(CSharpSyntaxTree.Create(root, options: parseOptions, path: "old path", Encoding.UTF8)).WithFilePath("new path"),
Microsoft.CodeAnalysis.CSharp.Test.Utilities (2)
Microsoft.CodeAnalysis.CSharp.WinRT.UnitTests (2)
Microsoft.CodeAnalysis.Debugging.Package (1)
Microsoft.CodeAnalysis.EditorFeatures (1)
Microsoft.CodeAnalysis.EditorFeatures.Text (2)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (6)
Microsoft.CodeAnalysis.ExpressionEvaluator.ExpressionCompiler (4)
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider (2)
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider.Utilities (2)
Microsoft.CodeAnalysis.Features (7)
Microsoft.CodeAnalysis.Features.Test.Utilities (11)
Microsoft.CodeAnalysis.Features.UnitTests (45)
EditAndContinue\EditAndContinueWorkspaceServiceTests.cs (34)
47var encodingE = Encoding.UTF8;
59var sourceBytesD1 = Encoding.UTF8.GetBytesWithPreamble(sourceD1);
394var sourceFilePath = dir.CreateFile(sourceFileName).WriteAllText(source, Encoding.UTF8).Path;
413solution = solution.AddDocument(designTimeOnlyDocumentId, designTimeOnlyFileName, SourceText.From(sourceDesignTimeOnly, Encoding.UTF8), filePath: designTimeOnlyFilePath);
433solution = solution.AddDocument(designTimeOnlyDocumentId, designTimeOnlyFileName, SourceText.From(sourceDesignTimeOnly, Encoding.UTF8), filePath: designTimeOnlyFilePath);
573var sourceFile = dir.CreateFile("a.cs").WriteAllText(source1, Encoding.UTF8);
626var sourceFile = dir.CreateFile("a.cs").WriteAllText(source1, Encoding.UTF8);
632AddDocument("a.cs", SourceText.From(source1, Encoding.UTF8, SourceHashAlgorithm.Sha1), filePath: sourceFile.Path);
684var sourceFileA = Temp.CreateFile().WriteAllText(sourceA, Encoding.UTF8);
685var sourceFileB = Temp.CreateFile().WriteAllText(sourceB, Encoding.UTF8);
749var sourceFileA = Temp.CreateFile().WriteAllText(sourceA, Encoding.UTF8);
750var sourceFileB = Temp.CreateFile().WriteAllText(sourceB, Encoding.UTF8);
781var sourceFile1 = Temp.CreateFile().WriteAllText(source1, Encoding.UTF8);
797var sourceFile2 = Temp.CreateFile().WriteAllText(source2, Encoding.UTF8);
852sourceFile.WriteAllText(source1, Encoding.UTF8);
1234sourceFile.WriteAllText(source1, Encoding.UTF8);
1267sourceFile.WriteAllText(source0, Encoding.UTF8);
1328var sourceFile = dir.CreateFile("a.cs").WriteAllText(source1, Encoding.UTF8);
1371var sourceFile = dir.CreateFile("a.cs").WriteAllText(source1, Encoding.UTF8);
1495File.WriteAllText(sourceFilePath, source3, Encoding.UTF8);
1911context.AddSource("generated.cs", SourceText.From("generated: " + additionalText, Encoding.UTF8, SourceHashAlgorithm.Sha256));
1984var sourceFileA = dir.CreateFile("a.cs").WriteAllText(sourceA1, Encoding.UTF8);
1985var sourceFileB = dir.CreateFile("b.cs").WriteAllText(sourceB1, Encoding.UTF8);
2322var sourceFile = dir.CreateFile("test.cs").WriteAllText(source1, Encoding.UTF8);
2360sourceFile.WriteAllText(source2, Encoding.UTF8);
2409var sourceFile = dir.CreateFile("test.cs").WriteAllText(source2, Encoding.UTF8);
2456sourceFile.WriteAllText(source1, Encoding.UTF8);
2481var sourceFile = dir.CreateFile("test.cs").WriteAllText(source1, Encoding.UTF8);
2542var sourceFile = dir.CreateFile("test.cs").WriteAllText(sourceOnDisk, Encoding.UTF8);
3678var sourcePath = dir.CreateFile("Lib.cs").WriteAllText(source1, Encoding.UTF8).Path;
3738File.WriteAllText(sourcePath, source2, Encoding.UTF8);
3775var sourcePath = dir.CreateFile("Lib.cs").WriteAllText(source1, Encoding.UTF8).Path;
4856var sourceFileA = dir.CreateFile("A.cs").WriteAllText(source1, Encoding.UTF8);
4870loader: new WorkspaceFileTextLoader(solution.Services, sourceFileA.Path, Encoding.UTF8),
Microsoft.CodeAnalysis.LanguageServer (1)
Microsoft.CodeAnalysis.LanguageServer.Protocol (2)
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (3)
Workspaces\LspWorkspaceManagerTests.cs (3)
88await testLspServer.TestWorkspace.ChangeDocumentAsync(firstDocument.Id, SourceText.From($"Some more text{markupOne}", System.Text.Encoding.UTF8, SourceHashAlgorithms.Default));
122await testLspServer.TestWorkspace.ChangeDocumentAsync(secondDocument.Id, SourceText.From("Two is now three!", System.Text.Encoding.UTF8, SourceHashAlgorithms.Default));
224var newSolution = testLspServer.TestWorkspace.CurrentSolution.AddDocument(newDocumentId, "NewDoc.cs", SourceText.From("New Doc", System.Text.Encoding.UTF8, SourceHashAlgorithms.Default), filePath: @"C:\NewDoc.cs");
Microsoft.CodeAnalysis.LanguageServer.UnitTests (1)
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (8)
Microsoft.CodeAnalysis.PublicApiAnalyzers (8)
Microsoft.CodeAnalysis.Rebuild (1)
Microsoft.CodeAnalysis.Rebuild.UnitTests (8)
Microsoft.CodeAnalysis.ResxSourceGenerator (12)
Microsoft.CodeAnalysis.ResxSourceGenerator.UnitTests (4)
Microsoft.CodeAnalysis.Scripting.TestUtilities (2)
Microsoft.CodeAnalysis.Test.Utilities (11)
Microsoft.CodeAnalysis.TestAnalyzerReference (3)
Microsoft.CodeAnalysis.UnitTests (32)
EmbeddedTextTests.cs (11)
42Assert.Throws<ArgumentException>("text", () => EmbeddedText.FromSource("path", SourceText.From(new byte[0], 0, Encoding.UTF8, canBeEmbedded: false)));
43Assert.Throws<ArgumentException>("text", () => EmbeddedText.FromSource("path", SourceText.From(new MemoryStream(new byte[0]), Encoding.UTF8, canBeEmbedded: false)));
116var bytes = Encoding.UTF8.GetBytes(SmallSource);
130var bytes = Encoding.UTF8.GetBytes(SmallSource);
145var source = SourceText.From(SmallSource, Encoding.UTF8, SourceHashAlgorithm.Sha1);
152AssertEx.Equal(Encoding.UTF8.GetPreamble().Concat(Encoding.UTF8.GetBytes(SmallSource)), text.Blob.Skip(4));
200var expected = SourceText.From(SmallSource, Encoding.UTF8, SourceHashAlgorithm.Sha1);
203var actual = SourceText.From(new StringReader(SmallSource), SmallSource.Length, Encoding.UTF8, SourceHashAlgorithm.Sha1);
215var expected = SourceText.From(LargeSource, Encoding.UTF8, SourceHashAlgorithm.Sha1);
218var actual = SourceText.From(new StringReader(LargeSource), LargeSource.Length, Encoding.UTF8, SourceHashAlgorithm.Sha1);
Text\LargeTextTests.cs (4)
22using (StreamWriter sw = new StreamWriter(stream, encoding ?? Encoding.UTF8, bufferSize: 1024, leaveOpen: true))
33return LargeText.Decode(stream, encoding ?? Encoding.UTF8, SourceHashAlgorithm.Sha1, throwIfBinaryDetected: true, canBeEmbedded: false);
38return LargeText.Decode(reader, length, encoding ?? Encoding.UTF8, SourceHashAlgorithm.Sha1);
115using (StreamWriter sw = new StreamWriter(stream, Encoding.UTF8, bufferSize: 1024, leaveOpen: true))
Microsoft.CodeAnalysis.VisualBasic (4)
Microsoft.CodeAnalysis.VisualBasic.CommandLine.UnitTests (3)
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (16)
Attributes\AttributeTests_MarshalAs.vb (2)
884{"CustomMarshaler6", New Byte() {&H2C, &H0, &H0, &H60}.Append(Encoding.UTF8.GetBytes("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" & ChrW(0)))},
886{"CustomMarshaler8", New Byte() {&H2C, &H0, &H0, &H59}.Append(Encoding.UTF8.GetBytes("System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" & ChrW(0)))},
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (9)
Semantics\OptionalArgumentTests.vb (9)
2023SyntaxFactory.ParseSyntaxTree(source1, path:="C:\filename", encoding:=Encoding.UTF8),
2024SyntaxFactory.ParseSyntaxTree(source2, path:="a\b\..\c\d", encoding:=Encoding.UTF8),
2025SyntaxFactory.ParseSyntaxTree(source3, path:="*", encoding:=Encoding.UTF8),
2026SyntaxFactory.ParseSyntaxTree(source4, path:=" ", encoding:=Encoding.UTF8)
2103SyntaxFactory.ParseSyntaxTree(source1, path:="C:\filename", encoding:=Encoding.UTF8),
2104SyntaxFactory.ParseSyntaxTree(source2, path:="a\b\..\c\d.vb", encoding:=Encoding.UTF8),
2105SyntaxFactory.ParseSyntaxTree(source3, path:="*", encoding:=Encoding.UTF8),
2106SyntaxFactory.ParseSyntaxTree(source4, path:="C:\x.vb", encoding:=Encoding.UTF8),
2107SyntaxFactory.ParseSyntaxTree(source5, path:="C:\x.vb", encoding:=Encoding.UTF8)
Microsoft.CodeAnalysis.VisualBasic.Syntax.UnitTests (2)
Microsoft.CodeAnalysis.VisualBasic.Test.Utilities (5)
Microsoft.CodeAnalysis.Workspaces (13)
Microsoft.CodeAnalysis.Workspaces.MSBuild (1)
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (2)
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (2)
Microsoft.CodeAnalysis.Workspaces.UnitTests (34)
SolutionTests\SolutionTests.cs (32)
58.AddDocument(DocumentId.CreateNewId(projectId), "goo.cs", SourceText.From("public class Goo { }", Encoding.UTF8, SourceHashAlgorithms.Default), filePath: Path.Combine(s_projectDir, "goo.cs"))
59.AddAdditionalDocument(DocumentId.CreateNewId(projectId), "add.txt", SourceText.From("text", Encoding.UTF8, SourceHashAlgorithms.Default))
60.AddAnalyzerConfigDocument(DocumentId.CreateNewId(projectId), "editorcfg", SourceText.From(editorConfig ?? "#empty", Encoding.UTF8, SourceHashAlgorithms.Default), filePath: Path.Combine(s_projectDir, "editorcfg"))));
80.AddDocument(DocumentId.CreateNewId(projectId1), "goo.cs", SourceText.From(docContents, Encoding.UTF8, SourceHashAlgorithms.Default), filePath: "goo.cs")
81.AddAdditionalDocument(DocumentId.CreateNewId(projectId1), "add.txt", SourceText.From("text", Encoding.UTF8, SourceHashAlgorithms.Default), filePath: "add.txt")
82.AddAnalyzerConfigDocument(DocumentId.CreateNewId(projectId1), "editorcfg", SourceText.From("config", Encoding.UTF8, SourceHashAlgorithms.Default), filePath: "/a/b")
84.AddDocument(DocumentId.CreateNewId(projectId2), "goo.cs", SourceText.From(docContents, Encoding.UTF8, SourceHashAlgorithms.Default), filePath: "goo.cs")
85.AddAdditionalDocument(DocumentId.CreateNewId(projectId2), "add.txt", SourceText.From("text", Encoding.UTF8, SourceHashAlgorithms.Default), filePath: "add.txt")
86.AddAnalyzerConfigDocument(DocumentId.CreateNewId(projectId2), "editorcfg", SourceText.From("config", Encoding.UTF8, SourceHashAlgorithms.Default), filePath: "/a/b")));
841.AddDocument(DocumentId.CreateNewId(projectId1), "goo.cs", SourceText.From(docContents, Encoding.UTF8, SourceHashAlgorithms.Default), filePath: "goo.cs")
843.AddDocument(DocumentId.CreateNewId(projectId2), "goo.cs", SourceText.From(docContents, Encoding.UTF8, SourceHashAlgorithms.Default), filePath: "goo.cs")));
1091.AddDocument(d1, "d1.cs", SourceText.From("class D1;", Encoding.UTF8, SourceHashAlgorithms.Default), filePath: Path.Combine(s_projectDir, "d1.cs"))
1092.AddDocument(d2, "d2.cs", SourceText.From("class D2;", Encoding.UTF8, SourceHashAlgorithms.Default), filePath: Path.Combine(s_projectDir, "d2.cs"))
1093.AddAdditionalDocument(a1, "a1.txt", SourceText.From("text1", Encoding.UTF8, SourceHashAlgorithms.Default))
1094.AddAdditionalDocument(a2, "a2.txt", SourceText.From("text2", Encoding.UTF8, SourceHashAlgorithms.Default))
1095.AddAnalyzerConfigDocument(c1, "c1", SourceText.From("#empty1", Encoding.UTF8, SourceHashAlgorithms.Default), filePath: Path.Combine(s_projectDir, "editorcfg"))
1096.AddAnalyzerConfigDocument(c2, "c2", SourceText.From("#empty2", Encoding.UTF8, SourceHashAlgorithms.Default), filePath: Path.Combine(s_projectDir, "editorcfg"));
1115loader: TextLoader.From(TextAndVersion.Create(SourceText.From("class NewD3;", Encoding.UTF8, SourceHashAlgorithms.Default), VersionStamp.Create(), filePath: Path.Combine(s_projectDir, "newD3.cs"))),
1134loader: TextLoader.From(TextAndVersion.Create(SourceText.From("new text3", Encoding.UTF8, SourceHashAlgorithms.Default), VersionStamp.Create(), filePath: Path.Combine(s_projectDir, "newD3.cs"))),
1153loader: TextLoader.From(TextAndVersion.Create(SourceText.From("#new empty3", Encoding.UTF8, SourceHashAlgorithms.Default), VersionStamp.Create(), filePath: Path.Combine(s_projectDir, "newD3.cs"))),
1244Assert.Same(Encoding.UTF8, newText3.Encoding);
1265Assert.Same(Encoding.UTF8, newAddText3.Encoding);
1286Assert.Same(Encoding.UTF8, newConfigText3.Encoding);
3317var file = Temp.CreateFile().WriteAllText(text1, Encoding.UTF8);
3327.AddDocument(did, "x", new WorkspaceFileTextLoader(workspace.Services.SolutionServices, file.Path, Encoding.UTF8));
3371var file = Temp.CreateFile().WriteAllText(text, Encoding.UTF8);
3376.AddDocument(did, "x", new WorkspaceFileTextLoader(workspace.Services.SolutionServices, file.Path, Encoding.UTF8));
3438var file = Temp.CreateFile().WriteAllText(text, Encoding.UTF8);
3443.AddDocument(did, "x", new WorkspaceFileTextLoader(workspace.Services.SolutionServices, file.Path, Encoding.UTF8));
3799.AddDocument(did, "test", SourceText.From(language == LanguageNames.CSharp ? "class C {}" : "Class C : End Class", Encoding.UTF8, SourceHashAlgorithm.Sha256), filePath: "old path");
3938.AddDocument(did, "x", new WorkspaceFileTextLoader(solution.Services, @"C:\doesnotexist.cs", Encoding.UTF8))
4548var loader = new TestSmallFileTextLoader(file.Path, Encoding.UTF8);
Microsoft.Data.Analysis (6)
Microsoft.Data.Analysis.Tests (1)
Microsoft.DotNet.Arcade.Sdk (6)
Microsoft.DotNet.Build.Tasks.Feed (5)
Microsoft.DotNet.Build.Tasks.Installers (9)
Microsoft.DotNet.Build.Tasks.Packaging (2)
Microsoft.DotNet.Build.Tasks.VisualStudio (8)
Microsoft.DotNet.Build.Tasks.Workloads (4)
Microsoft.DotNet.Deployment.Tasks.Links (1)
Microsoft.DotNet.Helix.Client (7)
Microsoft.DotNet.Helix.JobSender (2)
Microsoft.DotNet.Helix.Sdk (4)
Microsoft.DotNet.Internal.SymbolHelper (2)
Microsoft.DotNet.SignCheckLibrary (2)
Microsoft.Extensions.AI (2)
Microsoft.Extensions.AI.Abstractions (1)
Microsoft.Extensions.AI.Evaluation.Reporting (1)
Microsoft.Extensions.AI.Evaluation.Reporting.Tests (2)
Microsoft.Extensions.AI.Integration.Tests (4)
Microsoft.Extensions.AI.OpenAI (4)
Microsoft.Extensions.Caching.Abstractions (4)
Microsoft.Extensions.Caching.Hybrid (4)
Microsoft.Extensions.Caching.Hybrid.Tests (1)
Microsoft.Extensions.Caching.SqlServer.Tests (20)
SqlServerCacheWithDatabaseTest.cs (20)
77var expectedValue = Encoding.UTF8.GetBytes("Hello, World!");
99var expectedValue = Encoding.UTF8.GetBytes("Hello, World!");
126var expectedValue = Encoding.UTF8.GetBytes("Hello, World!");
166var expectedValue = Encoding.UTF8.GetBytes("Hello, World!");
208var expectedValue = Encoding.UTF8.GetBytes("Hello, World!");
235Encoding.UTF8.GetBytes("Hello, World!"),
259var expectedValue = Encoding.UTF8.GetBytes("Hello, World!");
291var expectedValue = Encoding.UTF8.GetBytes("Hello, World!");
318Encoding.UTF8.GetBytes("Hello, World!"),
341Encoding.UTF8.GetBytes("Hello, World!"),
364var expectedValue = Encoding.UTF8.GetBytes("Hello, World!");
393var expectedValue = Encoding.UTF8.GetBytes("Hello, World!");
420var expectedValue = Encoding.UTF8.GetBytes("Hello, World!");
489var expectedValue = Encoding.UTF8.GetBytes("Hello, World!");
521var expectedValue = Encoding.UTF8.GetBytes("Hello, World!");
577var expectedValue = Encoding.UTF8.GetBytes("Hello, World!");
606var expectedValue = Encoding.UTF8.GetBytes("Hello, World!");
636Encoding.UTF8.GetBytes("Hello, World!"),
653var expectedValue = Encoding.UTF8.GetBytes("Hello, World!");
676Encoding.UTF8.GetBytes("Hello, World!"),
Microsoft.Extensions.Caching.StackExchangeRedis (1)
Microsoft.Extensions.Caching.StackExchangeRedis.Tests (1)
Microsoft.Extensions.Configuration.KeyPerFile.Tests (1)
Microsoft.Extensions.FileProviders.Embedded.Tests (1)
Microsoft.Extensions.Hosting.Systemd (2)
Microsoft.Extensions.Http.Diagnostics (2)
Microsoft.Extensions.Http.Diagnostics.Tests (49)
Logging\HttpClientLoggerTest.cs (19)
87Content = new StringContent(input, Encoding.UTF8, TextPlain)
125Content = new StringContent(input, Encoding.UTF8, TextPlain)
187Content = new StringContent(requestContent, Encoding.UTF8, TextPlain)
196Content = new StringContent(responseContent, Encoding.UTF8, TextPlain),
283Content = new StringContent(requestContent, Encoding.UTF8, TextPlain)
290Content = new StringContent(responseContent, Encoding.UTF8, TextPlain),
388Content = new StringContent(requestContent, Encoding.UTF8, TextPlain)
396Content = new StringContent(responseContent, Encoding.UTF8, TextPlain),
484Content = new StringContent(requestContent, Encoding.UTF8, TextPlain)
492Content = new StringContent(responseContent, Encoding.UTF8, TextPlain),
599Content = new StringContent(requestContent, Encoding.UTF8, TextPlain)
606Content = new StringContent(responseContent, Encoding.UTF8, TextPlain),
691Content = new StringContent(_fixture.Create<string>(), Encoding.UTF8, TextPlain)
734Content = new StringContent(_fixture.Create<string>(), Encoding.UTF8, TextPlain)
772Content = new StringContent(_fixture.Create<string>(), Encoding.UTF8, TextPlain)
816Content = new StringContent(_fixture.Create<string>(), Encoding.UTF8, TextPlain)
859using var requestContent = new StreamContent(new NotSeekableStream(new(Encoding.UTF8.GetBytes(requestInput))));
870using var responseContent = new StreamContent(new NotSeekableStream(new(Encoding.UTF8.GetBytes(responseInput))));
961Content = new StringContent("request_content", Encoding.UTF8, TextPlain)
Logging\HttpRequestBodyReaderTest.cs (6)
41Content = new StringContent(input, Encoding.UTF8, "text/plain"),
85Content = new StringContent(input, Encoding.UTF8, contentType),
106Content = new StringContent(input, Encoding.UTF8, "text/plain"),
134Content = new StringContent(input, Encoding.UTF8, "text/plain"),
158Content = new StringContent(input, Encoding.UTF8, "text/plain"),
232Content = new StringContent("content", Encoding.UTF8, "text/plain"),
Logging\HttpRequestReaderTest.cs (15)
84Content = new StringContent(requestContent, Encoding.UTF8)
93Content = new StringContent(responseContent, Encoding.UTF8)
147Content = new StringContent(requestContent, Encoding.UTF8)
153Content = new StringContent(responseContent, Encoding.UTF8)
210Content = new StringContent(requestContent, Encoding.UTF8),
222Content = new StringContent(responseContent, Encoding.UTF8)
285Content = new StringContent(requestContent, Encoding.UTF8),
297Content = new StringContent(responseContent, Encoding.UTF8)
357Content = new StringContent(requestContent, Encoding.UTF8),
415Content = new StringContent(requestContent, Encoding.UTF8),
427Content = new StringContent(responseContent, Encoding.UTF8)
486Content = new StringContent(requestContent, Encoding.UTF8),
494Content = new StringContent(responseContent, Encoding.UTF8)
553Content = new StringContent(requestContent, Encoding.UTF8),
562Content = new StringContent(responseContent, Encoding.UTF8)
Microsoft.Extensions.Http.Resilience.Tests (1)
Microsoft.Extensions.Logging.Console (2)
Microsoft.Extensions.Logging.EventSource (1)
Microsoft.Extensions.Logging.Generators (1)
Microsoft.Extensions.Options.SourceGeneration (1)
Microsoft.Extensions.SecretManager.Tools.Tests (5)
Microsoft.Extensions.ServiceDiscovery.Dns.Tests (1)
Microsoft.Extensions.ServiceDiscovery.Dns.Tests.Fuzzing (1)
Microsoft.Extensions.Telemetry.Tests (1)
Microsoft.Extensions.Validation.GeneratorTests (2)
Microsoft.Extensions.Validation.ValidationsGenerator (1)
Microsoft.Gen.ComplianceReports (1)
Microsoft.Gen.Logging (1)
Microsoft.Gen.MetadataExtractor (3)
Microsoft.Gen.Metrics (2)
Microsoft.Gen.MetricsReports (1)
Microsoft.JSInterop (3)
Microsoft.JSInterop.Tests (8)
Microsoft.Maui (2)
Microsoft.Maui.Controls (1)
Microsoft.Maui.Controls.SourceGen (4)
Microsoft.Maui.Graphics (2)
Microsoft.ML.AutoML.SourceGenerator (3)
Microsoft.ML.AutoML.Tests (1)
Microsoft.ML.Core (8)
Microsoft.ML.Data (9)
Microsoft.ML.OnnxConverter (4)
Microsoft.ML.OnnxTransformer (1)
Microsoft.ML.TestFramework (1)
Microsoft.ML.Tokenizers (38)
SentencepieceModel.cs (5)
1399private readonly static string UnkPieceDefaultValue = global::System.Text.Encoding.UTF8.GetString(global::System.Convert.FromBase64String("PHVuaz4="), 0, 5);
1425private readonly static string BosPieceDefaultValue = global::System.Text.Encoding.UTF8.GetString(global::System.Convert.FromBase64String("PHM+"), 0, 3);
1451private readonly static string EosPieceDefaultValue = global::System.Text.Encoding.UTF8.GetString(global::System.Convert.FromBase64String("PC9zPg=="), 0, 4);
1477private readonly static string PadPieceDefaultValue = global::System.Text.Encoding.UTF8.GetString(global::System.Convert.FromBase64String("PHBhZD4="), 0, 5);
1503private readonly static string UnkSurfaceDefaultValue = global::System.Text.Encoding.UTF8.GetString(global::System.Convert.FromBase64String("IOKBhyA="), 0, 5);
Utils\Helpers.netstandard.cs (5)
76return Encoding.UTF8.GetBytes(sourcePtr, source.Length, destPtr, destination.Length);
85if (Encoding.UTF8.GetByteCount(sourcePtr, source.Length) <= destination.Length)
87bytesWritten = Encoding.UTF8.GetBytes(sourcePtr, source.Length, destPtr, destination.Length);
100return Encoding.UTF8.GetString(sourcePtr, utf8Bytes.Length);
109return Encoding.UTF8.GetChars(bytesPtr, bytes.Length, charsPtr, chars.Length);
Microsoft.ML.Tokenizers.Tests (13)
Microsoft.Net.Http.Headers (3)
Microsoft.VisualBasic.Core (3)
Microsoft.VisualBasic.Forms (1)
Microsoft.VisualBasic.Forms.Tests (3)
Microsoft.VisualStudio.LanguageServices (3)
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (1)
PlaintextApp (1)
PresentationBuildTasks (1)
PresentationFramework (3)
RazorBuildWebSite (1)
ReachFramework (7)
Replay (2)
Roslyn.Diagnostics.Analyzers (8)
Roslyn.Test.PdbUtilities (4)
Roslyn.VisualStudio.Next.UnitTests (9)
Services\ServiceHubServicesTests.cs (7)
512=> SourceText.From(content, encoding ?? Encoding.UTF8, checksumAlgorithm);
601[("SG.cs", CreateText("X", Encoding.UTF8))]);
608[("SG.cs", CreateText("X", Encoding.UTF8, checksumAlgorithm: SourceHashAlgorithm.Sha1))],
609[("SG.cs", CreateText("X", Encoding.UTF8, checksumAlgorithm: SourceHashAlgorithm.Sha256))]);
735return ImmutableArray.Create(("hint", SourceText.From($"// generated document {callCount}", Encoding.UTF8)));
819return ImmutableArray.Create(("hint", SourceText.From($"// generated document {callCount}", Encoding.UTF8)));
874return ImmutableArray.Create(("hint", SourceText.From($"// generated document {callCount}", Encoding.UTF8)));
RoutingSandbox (4)
RoutingWebSite (3)
Security.TransportSecurity.IntegrationTests (8)
Https\HttpsTests.4.1.0.cs (6)
82CustomBinding binding = new CustomBinding(new TextMessageEncodingBindingElement(MessageVersion.Soap11, Encoding.UTF8), new HttpsTransportBindingElement());
160CustomBinding binding = new CustomBinding(new TextMessageEncodingBindingElement(MessageVersion.Soap11, Encoding.UTF8), new HttpsTransportBindingElement());
199CustomBinding binding = new CustomBinding(new TextMessageEncodingBindingElement(MessageVersion.Soap12WSAddressing10, Encoding.UTF8), new HttpsTransportBindingElement());
240CustomBinding binding = new CustomBinding(new TextMessageEncodingBindingElement(MessageVersion.Soap11, Encoding.UTF8), new HttpsTransportBindingElement());
286CustomBinding binding = new CustomBinding(new TextMessageEncodingBindingElement(MessageVersion.Soap11, Encoding.UTF8), new HttpsTransportBindingElement());
327CustomBinding binding = new CustomBinding(new TextMessageEncodingBindingElement(MessageVersion.Soap11, Encoding.UTF8), new HttpsTransportBindingElement());
SecurityWebSite (1)
SemanticSearch.BuildTask (2)
ServiceBusWorker (1)
Shared (4)
SignalRSamples (3)
SocialWeather (2)
System.CodeDom (7)
System.ComponentModel.TypeConverter (2)
System.Configuration.ConfigurationManager (2)
System.Console (3)
System.Diagnostics.Process (7)
System.Formats.Tar (15)
System.IO.Compression (4)
System.IO.FileSystem.Watcher (1)
System.IO.MemoryMappedFiles (2)
System.IO.Packaging (3)
System.Memory.Data (2)
System.Net.Http (10)
System.Net.Http.Json (5)
System.Net.HttpListener (4)
System.Net.Mail (6)
System.Net.Ping (2)
System.Net.Primitives (2)
System.Net.Requests (2)
System.Net.Security (6)
src\libraries\Common\src\Microsoft\Win32\SafeHandles\GssSafeHandles.cs (3)
22out minorStatus, name, Encoding.UTF8.GetByteCount(name), out retHandle);
39out minorStatus, name, Encoding.UTF8.GetByteCount(name), out retHandle);
120status = Interop.NetSecurityNative.InitiateCredWithPassword(out minorStatus, packageType, userHandle, password, Encoding.UTF8.GetByteCount(password), out retHandle);
System.Net.ServerSentEvents (4)
System.Net.Sockets (3)
System.Net.WebClient (2)
System.Net.WebSockets (2)
System.Net.WebSockets.Client (2)
System.Private.CoreLib (119)
src\libraries\System.Private.CoreLib\src\System\Globalization\NumberFormatInfo.cs (15)
273Unsafe.BitCast<ReadOnlySpan<byte>, ReadOnlySpan<TChar>>(_currencyDecimalSeparatorUtf8 ??= Encoding.UTF8.GetBytes(_currencyDecimalSeparator));
365Unsafe.BitCast<ReadOnlySpan<byte>, ReadOnlySpan<TChar>>(_currencyGroupSeparatorUtf8 ??= Encoding.UTF8.GetBytes(_currencyGroupSeparator));
387Unsafe.BitCast<ReadOnlySpan<byte>, ReadOnlySpan<TChar>>(_currencySymbolUtf8 ??= Encoding.UTF8.GetBytes(_currencySymbol));
390internal byte[]? CurrencySymbolUtf8 => _currencySymbolUtf8 ??= Encoding.UTF8.GetBytes(_currencySymbol);
433Unsafe.BitCast<ReadOnlySpan<byte>, ReadOnlySpan<TChar>>(_nanSymbolUtf8 ??= Encoding.UTF8.GetBytes(_nanSymbol));
518Unsafe.BitCast<ReadOnlySpan<byte>, ReadOnlySpan<TChar>>(_negativeInfinitySymbolUtf8 ??= Encoding.UTF8.GetBytes(_negativeInfinitySymbol));
541Unsafe.BitCast<ReadOnlySpan<byte>, ReadOnlySpan<TChar>>(_negativeSignUtf8 ??= Encoding.UTF8.GetBytes(_negativeSign));
577Unsafe.BitCast<ReadOnlySpan<byte>, ReadOnlySpan<TChar>>(_numberDecimalSeparatorUtf8 ??= Encoding.UTF8.GetBytes(_numberDecimalSeparator));
598Unsafe.BitCast<ReadOnlySpan<byte>, ReadOnlySpan<TChar>>(_numberGroupSeparatorUtf8 ??= Encoding.UTF8.GetBytes(_numberGroupSeparator));
635Unsafe.BitCast<ReadOnlySpan<byte>, ReadOnlySpan<TChar>>(_positiveInfinitySymbolUtf8 ??= Encoding.UTF8.GetBytes(_positiveInfinitySymbol));
658Unsafe.BitCast<ReadOnlySpan<byte>, ReadOnlySpan<TChar>>(_positiveSignUtf8 ??= Encoding.UTF8.GetBytes(_positiveSign));
694Unsafe.BitCast<ReadOnlySpan<byte>, ReadOnlySpan<TChar>>(_percentDecimalSeparatorUtf8 ??= Encoding.UTF8.GetBytes(_percentDecimalSeparator));
715Unsafe.BitCast<ReadOnlySpan<byte>, ReadOnlySpan<TChar>>(_percentGroupSeparatorUtf8 ??= Encoding.UTF8.GetBytes(_percentGroupSeparator));
736Unsafe.BitCast<ReadOnlySpan<byte>, ReadOnlySpan<TChar>>(_percentSymbolUtf8 ??= Encoding.UTF8.GetBytes(_percentSymbol));
758Unsafe.BitCast<ReadOnlySpan<byte>, ReadOnlySpan<TChar>>(_perMilleSymbolUtf8 ??= Encoding.UTF8.GetBytes(_perMilleSymbol));
src\libraries\System.Private.CoreLib\src\System\IO\StreamReader.cs (5)
110: this(stream, Encoding.UTF8, detectEncodingFromByteOrderMarks, DefaultBufferSize, false)
158_encoding = encoding ??= Encoding.UTF8;
186: this(path, Encoding.UTF8, detectEncodingFromByteOrderMarks, DefaultBufferSize)
206: this(path, Encoding.UTF8, true, options)
503_encoding = Encoding.UTF8;
System.Private.CoreLib.Generators (4)
System.Private.DataContractSerialization (37)
System\Runtime\Serialization\Json\XmlJsonReader.cs (8)
603XmlExceptionHelper.ThrowTokenExpected(this, "false", Encoding.UTF8.GetString(buffer, offset, 5));
611XmlExceptionHelper.ThrowTokenExpected(this, "false", Encoding.UTF8.GetString(buffer, offset, 4) + (char)ch);
624XmlExceptionHelper.ThrowTokenExpected(this, "true", Encoding.UTF8.GetString(buffer, offset, 4));
632XmlExceptionHelper.ThrowTokenExpected(this, "true", Encoding.UTF8.GetString(buffer, offset, 4) + (char)ch);
645XmlExceptionHelper.ThrowTokenExpected(this, "null", Encoding.UTF8.GetString(buffer, offset, 4));
658XmlExceptionHelper.ThrowTokenExpected(this, "null", Encoding.UTF8.GetString(buffer, offset, 4) + (char)ch);
1196string bufferAsString = Encoding.UTF8.GetString(buffer, offset, 4);
1207bufferAsString = Encoding.UTF8.GetString(buffer, offset, 4);
System\Xml\XmlCanonicalWriter.cs (7)
184_element.prefixLength = Encoding.UTF8.GetByteCount(prefix);
186_element.localNameLength = Encoding.UTF8.GetByteCount(localName);
254if (string.Equals(Encoding.UTF8.GetString(_xmlnsBuffer!, xmlnsAttribute.prefixOffset, xmlnsAttribute.prefixLength), _inclusivePrefixes[i], StringComparison.Ordinal))
371xmlnsAttribute.prefixLength = Encoding.UTF8.GetBytes(prefix, 0, prefix.Length, _xmlnsBuffer, _xmlnsOffset);
374xmlnsAttribute.nsLength = Encoding.UTF8.GetBytes(ns, 0, ns.Length, _xmlnsBuffer, _xmlnsOffset);
424_attribute.prefixLength = Encoding.UTF8.GetByteCount(prefix);
426_attribute.localNameLength = Encoding.UTF8.GetByteCount(localName);
System\Xml\XmlNodeWriter.cs (8)
37WriteStartElement(Encoding.UTF8.GetString(prefixBuffer, prefixOffset, prefixLength), Encoding.UTF8.GetString(localNameBuffer, localNameOffset, localNameLength));
52WriteEndElement(Encoding.UTF8.GetString(prefixBuffer, prefixOffset, prefixLength), Encoding.UTF8.GetString(localNameBuffer, localNameOffset, localNameLength));
57WriteXmlnsAttribute(Encoding.UTF8.GetString(prefixBuffer, prefixOffset, prefixLength), Encoding.UTF8.GetString(nsBuffer, nsOffset, nsLength));
63WriteStartAttribute(Encoding.UTF8.GetString(prefixBuffer, prefixOffset, prefixLength), Encoding.UTF8.GetString(localNameBuffer, localNameOffset, localNameLength));
System.Private.Windows.Core (4)
System.Private.Xml (6)
System.Reflection.Emit (1)
System.Reflection.Metadata (5)
System.Reflection.MetadataLoadContext (2)
System.Resources.Extensions (4)
System.Resources.Writer (2)
System.Security.Cryptography (10)
System.Security.Cryptography.Pkcs (3)
System.Security.Cryptography.Xml (16)
System.ServiceModel.Federation (2)
System.ServiceModel.NetFramingBase (3)
System.ServiceModel.NetNamedPipe (1)
System.ServiceModel.Primitives.Tests (2)
System.Text.Json (4)
System.Text.Json.SourceGeneration (2)
System.Text.RegularExpressions.Generator (1)
System.Web.HttpUtility (7)
System.Windows.Forms (8)
System.Windows.Forms.Analyzers.CSharp.Tests (1)
System.Windows.Forms.Analyzers.Tests (1)
System.Windows.Forms.Design.Tests (1)
System.Windows.Forms.Tests (10)
Templates.Tests (1)
Test.Utilities (8)
Text.Analyzers (8)
UnitTests.Common (1)
vbc (2)
VBCSCompiler (2)
VisualBasicErrorFactsGenerator (1)
VisualBasicSyntaxGenerator (6)
Program.vb (6)
78Using output As New StreamWriter(New FileStream(mainFile, FileMode.Create, FileAccess.Write), Encoding.UTF8)
126Using output As New StreamWriter(New FileStream(outputFile, FileMode.Create, FileAccess.Write), Encoding.UTF8)
142Using output As New StreamWriter(New FileStream(outputFile, FileMode.Create, FileAccess.Write), Encoding.UTF8)
161Using output As New StreamWriter(New FileStream(mainFile, FileMode.Create, FileAccess.Write), Encoding.UTF8)
172Using output As New StreamWriter(New FileStream(syntaxFile, FileMode.Create, FileAccess.Write), Encoding.UTF8)
178Using output As New StreamWriter(New FileStream(internalFile, FileMode.Create, FileAccess.Write), Encoding.UTF8)
WebSocketSample (2)