1016 references to From
Analyzer.Utilities.UnitTests (3)
ConfigurationSchemaGenerator.Tests (2)
EventSourceGenerator (1)
GenerateDocumentationAndConfigFiles (3)
IdeCoreBenchmarks (3)
Metrics (3)
Metrics.Legacy (3)
Microsoft.Analyzers.Extra.Tests (2)
Microsoft.Analyzers.Local.Tests (2)
Microsoft.AspNetCore.Analyzer.Testing (2)
Microsoft.AspNetCore.App.Analyzers (1)
Microsoft.AspNetCore.App.Analyzers.Test (1)
Microsoft.AspNetCore.Components.Analyzers.Tests (1)
Microsoft.AspNetCore.Components.SdkAnalyzers.Tests (1)
Microsoft.AspNetCore.Http.Microbenchmarks (2)
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (1)
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.Test (1)
Microsoft.AspNetCore.SignalR.Client.SourceGenerator (4)
Microsoft.CodeAnalysis (13)
Microsoft.CodeAnalysis.Analyzers (3)
Microsoft.CodeAnalysis.AnalyzerUtilities (3)
Microsoft.CodeAnalysis.BannedApiAnalyzers (3)
Microsoft.CodeAnalysis.CodeStyle (4)
Microsoft.CodeAnalysis.CodeStyle.UnitTestUtilities (2)
Microsoft.CodeAnalysis.CSharp (11)
Syntax\CSharpSyntaxTree.cs (2)
459return ParseText(SourceText.From(text, encoding, SourceHashAlgorithm.Sha1), options, path, diagnosticOptions, isGeneratedCode, cancellationToken);
920=> ParseText(SourceText.From(text, encoding, SourceHashAlgorithm.Sha1), options, path, diagnosticOptions, isGeneratedCode: null, cancellationToken);
Syntax\SyntaxFactory.cs (4)
1591return CSharpSyntaxTree.ParseText(SourceText.From(text, encoding, SourceHashAlgorithm.Sha1), (CSharpParseOptions?)options, path, diagnosticOptions: null, isGeneratedCode: null, cancellationToken);
1952return SourceText.From(text, Encoding.UTF8).GetSubText(offset);
2838return ParseSyntaxTree(SourceText.From(text, encoding), options, path, diagnosticOptions, isGeneratedCode: null, cancellationToken);
2866return ParseSyntaxTree(SourceText.From(text, encoding), options, path, diagnosticOptions, isGeneratedCode, cancellationToken);
Microsoft.CodeAnalysis.CSharp.CodeStyle (1)
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (1)
Microsoft.CodeAnalysis.CSharp.EditorFeatures (6)
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (64)
PdbSourceDocument\ImplementationAssemblyLookupServiceTests.cs (17)
39var sourceText = SourceText.From(metadataSource, encoding: Encoding.UTF8);
73var sourceText = SourceText.From(metadataSource, encoding: Encoding.UTF8);
111var sourceText = SourceText.From(metadataSource, encoding: Encoding.UTF8);
142var sourceText = SourceText.From(metadataSource, Encoding.UTF8);
167sourceText = SourceText.From("""
199var sourceText = SourceText.From(metadataSource, encoding: Encoding.UTF8);
223sourceText = SourceText.From("""
256var sourceText = SourceText.From(metadataSource, encoding: Encoding.UTF8);
280sourceText = SourceText.From("""
307var sourceText = SourceText.From(metadataSource, encoding: Encoding.UTF8);
331sourceText = SourceText.From("""
354var sourceText = SourceText.From(metadataSource, encoding: Encoding.UTF8);
378sourceText = SourceText.From("""
412var sourceText = SourceText.From(metadataSource, encoding: Encoding.UTF8);
436sourceText = SourceText.From("""
474var sourceText = SourceText.From(metadataSource, encoding: Encoding.UTF8);
498var typeForwardSourceText = SourceText.From(typeForwardSource, Encoding.UTF8);
PdbSourceDocument\PdbSourceDocumentTests.cs (13)
327var sourceText = SourceText.From(metadataSource, encoding: Encoding.UTF8);
353var sourceText = SourceText.From(metadataSource, encoding: Encoding.UTF8);
385var sourceText = SourceText.From(metadataSource, Encoding.UTF8);
426var sourceText = SourceText.From(metadataSource, Encoding.UTF8);
453sourceText = SourceText.From("""
623CompileTestSource(path, SourceText.From("""
775var sourceText = SourceText.From(source, Encoding.UTF8);
826var sourceText1 = SourceText.From(source1, Encoding.UTF8);
827var sourceText2 = SourceText.From(source2, Encoding.UTF8);
872var result = service.TryAddDocumentToWorkspace(requestPath, new StaticSourceTextContainer(SourceText.From(string.Empty)), out var documentId);
891var openResult = service.TryAddDocumentToWorkspace(file.FilePath, new StaticSourceTextContainer(SourceText.From(string.Empty)), out var documentId);
934var openResult = service.TryAddDocumentToWorkspace(fileOne.FilePath, new StaticSourceTextContainer(SourceText.From(string.Empty)), out var documentId);
945Assert.Throws<System.ArgumentException>(() => service.TryAddDocumentToWorkspace(fileTwo.FilePath, new StaticSourceTextContainer(SourceText.From(string.Empty)), out var documentIdTwo));
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (1)
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (7)
PDB\PDBTests.cs (4)
47var tree3 = SyntaxFactory.ParseSyntaxTree(SourceText.From("class C { }", encoding: null), path: "Bar.cs");
68var tree4 = SyntaxFactory.ParseSyntaxTree(SourceText.From("class D { public void F() { } }", new UTF8Encoding(false, false)), path: "Baz.cs");
104context.AddSource("hint2", SourceText.From("class G2 { void F() {} }", Encoding.UTF8, checksumAlgorithm: SourceHashAlgorithm.Sha256));
106Assert.Throws<ArgumentException>(() => context.AddSource("hint3", SourceText.From("class G3 { void F() {} }", encoding: null, checksumAlgorithm: SourceHashAlgorithm.Sha256)));
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (10)
EditAndContinue\CSharpEditAndContinueAnalyzerTests.cs (10)
299var newSolution = oldSolution.WithDocumentText(documentId, SourceText.From(source2));
364var newSolution = oldSolution.WithDocumentText(documentId, SourceText.From(source2));
428var newSolution = oldSolution.WithDocumentText(documentId, SourceText.From(source2));
510var newSolution = workspace.CurrentSolution.WithDocumentText(documentId, SourceText.From(source2));
580var newSolution = oldSolution.WithDocumentText(documentId, SourceText.From(source2));
620var newSolution = oldSolution.WithDocumentText(documentId, SourceText.From(source2));
661var newSolution = oldSolution.AddDocument(newDocId, "goo.cs", SourceText.From(source2), filePath: Path.Combine(TempRoot.Root, "goo.cs"));
707var newSolution = oldSolution.AddDocument(newDocId, "goo.cs", SourceText.From(source2), filePath: Path.Combine(TempRoot.Root, "goo.cs"));
740var newSolution = oldSolution.AddDocument(documentId, "goo.cs", SourceText.From(source2), filePath: filePath);
797var newSolution = oldSolution.WithDocumentText(documentId, SourceText.From(source2));
Microsoft.CodeAnalysis.CSharp.Scripting (1)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (53)
SourceGeneration\AdditionalSourcesCollectionTests.cs (23)
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));
225asc.Add("file2.cs", SourceText.From("", Encoding.UTF32));
226asc.Add("file3.cs", SourceText.From("", Encoding.Unicode));
229Assert.Throws<ArgumentException>(() => asc.Add("file4.cs", SourceText.From("")));
232Assert.Throws<ArgumentException>(() => asc.Add("file5.cs", SourceText.From("", encoding: null)));
234var exception = Assert.Throws<ArgumentException>(() => asc.Add("file5.cs", SourceText.From("", encoding: null)));
SourceGeneration\GeneratorDriverTests.cs (12)
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));
780var generator = new CallbackGenerator((ic) => { }, (sgc) => { sgc.AddSource("a", SourceText.From("")); });
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (140)
Syntax\SyntaxTreeTests.cs (9)
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),
142SourceText.From(""),
149var newTree = tree.WithChangedText(SourceText.From("class C { }"));
157SourceText.From(""),
173SourceText.From(""),
189SourceText.From(""),
259var oldText = SourceText.From("class B {}", Encoding.Unicode, SourceHashAlgorithms.Default);
301var oldText = SourceText.From("class B {}", Encoding.Unicode, SourceHashAlgorithms.Default);
Microsoft.CodeAnalysis.CSharp.Test.Utilities (3)
Microsoft.CodeAnalysis.CSharp.Workspaces (1)
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (3)
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (3)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (21)
Diagnostics\DiagnosticAnalyzerServiceTests.cs (6)
164project = project.AddAnalyzerConfigDocument(".editorconfig", filePath: "z:\\.editorconfig", text: SourceText.From($"""
172var document = project.AddDocument("test.cs", SourceText.From("class A {}"), filePath: "z:\\test.cs");
255loader: TextLoader.From(TextAndVersion.Create(SourceText.From("class A {}"), VersionStamp.Create(), filePath: "test.cs")),
298text: SourceText.From($"""
331loader: TextLoader.From(TextAndVersion.Create(SourceText.From("class A {}"), VersionStamp.Create(), filePath: "test.cs")),
946return workspace.AddDocument(project.Id, "Empty.cs", SourceText.From("class A { B B {get} }"));
Microsoft.CodeAnalysis.Features (7)
Microsoft.CodeAnalysis.Features.Test.Utilities (6)
Microsoft.CodeAnalysis.Features.UnitTests (22)
EditAndContinue\CompileTimeSolutionProviderTests.cs (5)
48AddAdditionalDocument(additionalDocumentId, "additional", SourceText.From(""), filePath: additionalFilePath).
49AddAnalyzerConfigDocument(analyzerConfigId, "config", SourceText.From(""), filePath: "RazorSourceGenerator.razorencconfig").
102context.AddSource("hint", SourceText.From(s));
114.AddAdditionalDocument(additionalDocumentId, "additional", SourceText.From(""), filePath: "additional.razor")
115.AddAnalyzerConfigDocument(analyzerConfigId, "config", SourceText.From("is_global = true\r\nbuild_property.SuppressRazorSourceGenerator = true"), filePath: "Z:\\RazorSourceGenerator.razorencconfig"),
EditAndContinue\EditAndContinueWorkspaceServiceTests.cs (6)
923solution = solution.AddDocument(designTimeOnlyDocumentId, designTimeOnlyFileName, SourceText.From(sourceDesignTimeOnly, Encoding.UTF8), filePath: designTimeOnlyFilePath);
942solution = solution.AddDocument(designTimeOnlyDocumentId, designTimeOnlyFileName, SourceText.From(sourceDesignTimeOnly, Encoding.UTF8), filePath: designTimeOnlyFilePath);
1143AddDocument("a.cs", SourceText.From(source1, Encoding.UTF8, SourceHashAlgorithm.Sha1), filePath: sourceFile.Path);
1517AddDocument(documentId, "test.cs", SourceText.From(source1, encoding, SourceHashAlgorithm.Sha1), filePath: sourceFile.Path);
2402context.AddSource("generated.cs", SourceText.From("generated: " + additionalText, Encoding.UTF8, SourceHashAlgorithm.Sha256));
2921solution = solution.WithDocumentText(document1.Id, SourceText.From("class C1 { void M() { System.Console.WriteLine(2); } }", encoding: null, SourceHashAlgorithms.Default));
Microsoft.CodeAnalysis.LanguageServer (1)
Microsoft.CodeAnalysis.LanguageServer.Protocol (3)
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (25)
Workspaces\LspWorkspaceManagerTests.cs (5)
85await testLspServer.TestWorkspace.ChangeDocumentAsync(firstDocument.Id, SourceText.From($"Some more text{markupOne}", System.Text.Encoding.UTF8, SourceHashAlgorithms.Default));
119await testLspServer.TestWorkspace.ChangeDocumentAsync(secondDocument.Id, SourceText.From("Two is now three!", System.Text.Encoding.UTF8, SourceHashAlgorithms.Default));
221var newSolution = testLspServer.TestWorkspace.CurrentSolution.AddDocument(newDocumentId, "NewDoc.cs", SourceText.From("New Doc", System.Text.Encoding.UTF8, SourceHashAlgorithms.Default), filePath: @"C:\NewDoc.cs");
516.AddDocument(filePath, SourceText.From("ProjectSystemText"), filePath: filePath)
573testLspServer.TestWorkspace.CurrentSolution.WithDocumentText(document.Id, SourceText.From("New Disk Contents")));
Microsoft.CodeAnalysis.LanguageServer.UnitTests (2)
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (3)
Microsoft.CodeAnalysis.PublicApiAnalyzers (3)
Microsoft.CodeAnalysis.PublicApiAnalyzers.CodeFixes (2)
Microsoft.CodeAnalysis.Rebuild.UnitTests (1)
Microsoft.CodeAnalysis.ResxSourceGenerator (7)
Microsoft.CodeAnalysis.ResxSourceGenerator.UnitTests (2)
Microsoft.CodeAnalysis.Scripting (4)
Hosting\CommandLine\CommandLineRunner.cs (3)
231var script = Script.CreateInitialScript<object>(_scriptCompiler, SourceText.From(initialScriptCodeOpt), options, globals.GetType(), assemblyLoaderOpt: null);
258var tree = _scriptCompiler.ParseSubmission(SourceText.From(input.ToString()), options.ParseOptions, cancellationToken);
283newScript = Script.CreateInitialScript<object>(_scriptCompiler, SourceText.From(code ?? string.Empty), options, globals.GetType(), assemblyLoaderOpt: null);
Microsoft.CodeAnalysis.Scripting.TestUtilities (3)
Microsoft.CodeAnalysis.Test.Utilities (15)
Microsoft.CodeAnalysis.TestAnalyzerReference (4)
Microsoft.CodeAnalysis.UnitTests (149)
EmbeddedTextTests.cs (6)
39Assert.Throws<ArgumentException>("text", () => EmbeddedText.FromSource("path", SourceText.From("source")));
103var source = SourceText.From("", new UTF8Encoding(encoderShouldEmitUTF8Identifier: false), SourceHashAlgorithm.Sha1);
145var source = SourceText.From(SmallSource, Encoding.UTF8, SourceHashAlgorithm.Sha1);
187var source = SourceText.From(LargeSource, Encoding.Unicode, SourceHashAlgorithms.Default);
200var expected = SourceText.From(SmallSource, Encoding.UTF8, SourceHashAlgorithm.Sha1);
215var expected = SourceText.From(LargeSource, Encoding.UTF8, SourceHashAlgorithm.Sha1);
Text\SourceTextTests.cs (30)
29SourceText[] texts = [SourceText.From(string.Empty), SourceText.From([], 0), SourceText.From(new MemoryStream())];
56Assert.Same(s_utf8, SourceText.From(HelloWorld, s_utf8).Encoding);
57Assert.Same(s_unicode, SourceText.From(HelloWorld, s_unicode).Encoding);
85Assert.Equal(SourceHashAlgorithm.Sha1, SourceText.From(HelloWorld).ChecksumAlgorithm);
99Assert.Equal(algorithm, SourceText.From(HelloWorld, checksumAlgorithm: algorithm).ChecksumAlgorithm);
121verifyChecksumAndContentHash(SourceText.From(HelloWorld, encodingNoBOM, checksumAlgorithm), checksumNoBOM, expectedContentHash);
122verifyChecksumAndContentHash(SourceText.From(HelloWorld, encodingBOM, checksumAlgorithm), checksumBOM, expectedContentHash);
166verifyChecksumAndContentHash(fromChanges(SourceText.From(HelloWorld, encodingNoBOM, checksumAlgorithm)), checksumNoBOM, expectedContentHash);
167verifyChecksumAndContentHash(fromChanges(SourceText.From(HelloWorld, encodingBOM, checksumAlgorithm)), checksumBOM, expectedContentHash);
213var f = SourceText.From(HelloWorld, s_utf8);
215Assert.True(f.ContentEquals(SourceText.From(HelloWorld, s_utf8)));
216Assert.False(f.ContentEquals(SourceText.From(HelloWorld + "o", s_utf8)));
217Assert.True(SourceText.From(HelloWorld, s_utf8).ContentEquals(SourceText.From(HelloWorld, s_utf8)));
353var expectedSourceText = SourceText.From(expected);
369var expectedSourceText = SourceText.From(expected);
425var sourceText = SourceText.From("ABCDEFGHIJKLMNOPQRSTUVWXYZ");
444var sourceText = SourceText.From(Text);
456SourceText.From("ABC").Write(TextWriter.Null, TextSpan.FromBounds(4, 4)));
465SourceText.From("ABC").Write(TextWriter.Null, TextSpan.FromBounds(2, 4)));
479var text1 = SourceText.From(content, utf8);
480var text2 = SourceText.From(content, unicode);
526var text1 = SourceText.From("content1");
527var text2 = SourceText.From("content2");
543var text = SourceText.From("content");
568var text2 = SourceText.From(content, Encoding.UTF8);
585var text1 = SourceText.From(content, Encoding.UTF8);
586var text2 = SourceText.From(content, Encoding.Unicode);
600var text1 = SourceText.From(content, Encoding.UTF8);
601var text2 = SourceText.From(content, Encoding.Unicode);
Text\TextUtilitiesTests.cs (8)
35Assert.Equal(0, TextUtilities.GetLengthOfLineBreak(SourceText.From("aoeu"), 0));
36Assert.Equal(0, TextUtilities.GetLengthOfLineBreak(SourceText.From("aoeu"), 2));
45Assert.Equal(1, TextUtilities.GetLengthOfLineBreak(SourceText.From("\naoeu"), 0));
46Assert.Equal(1, TextUtilities.GetLengthOfLineBreak(SourceText.From("a\nbaou"), 1));
47Assert.Equal(0, TextUtilities.GetLengthOfLineBreak(SourceText.From("a\n"), 0));
56Assert.Equal(2, TextUtilities.GetLengthOfLineBreak(SourceText.From("\r\n"), 0));
57Assert.Equal(1, TextUtilities.GetLengthOfLineBreak(SourceText.From("\n\r"), 0));
66Assert.Equal(1, TextUtilities.GetLengthOfLineBreak(SourceText.From("\r"), 0));
Microsoft.CodeAnalysis.VisualBasic (8)
Syntax\SyntaxNodeFactories.vb (3)
50Return ParseSyntaxTree(SourceText.From(text, encoding, SourceHashAlgorithm.Sha1), options, path, cancellationToken)
79Return ParseSyntaxTree(SourceText.From(text, encoding), options, path, diagnosticOptions, cancellationToken)
288Return SourceText.From(text, Encoding.UTF8).GetSubText(offset)
Microsoft.CodeAnalysis.Workspaces (9)
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (10)
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (5)
Microsoft.CodeAnalysis.Workspaces.UnitTests (213)
FindReferencesTests.cs (5)
40return solution.AddProject(pi).AddDocument(did, $"{projectName}.{suffix}", SourceText.From(code));
56return solution.AddProject(pi).AddDocument(did, $"{projectName}.{suffix}", SourceText.From(code));
66.AddDocument(did, "goo.cs", SourceText.From(sourceText));
82solution = solution.AddDocument(did, $"goo{docCounter++}.cs", SourceText.From(sourceText));
130.AddDocument(did, "goo.cs", SourceText.From(text));
Formatter\FormatterTests.cs (5)
42=> document.WithText(SourceText.From($"Formatted with options: {lineFormattingOptions.ToString().Replace("\r", "\\r").Replace("\n", "\\n")}"));
52var document = workspace.AddDocument(project.Id, "File.dummy", SourceText.From("dummy"));
70var document = workspace.AddDocument(project.Id, "File.dummy", SourceText.From("dummy"));
115var csDocument = workspace.AddDocument(csProject.Id, "File.cs", SourceText.From("class C { }"));
116var vbDocument = workspace.AddDocument(vbProject.Id, "File.vb", SourceText.From("Class C : End Class"));
SolutionTests\SolutionTests.cs (89)
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")));
332.AddAnalyzerConfigDocument(DocumentId.CreateNewId(projectId), "editorcfg", SourceText.From("config"));
348var text = SourceText.From("new text", encoding: null, SourceHashAlgorithm.Sha1);
372var textAndVersion = TextAndVersion.Create(SourceText.From("new text"), VersionStamp.Default);
396var text = SourceText.From("new text");
449var text = SourceText.From("new text", encoding: null, SourceHashAlgorithm.Sha1);
537var text = SourceText.From("new text", encoding: null, SourceHashAlgorithm.Sha1);
620var text = SourceText.From("new text without pp directives", encoding: null, SourceHashAlgorithm.Sha1);
703var text = SourceText.From("#if true", encoding: null, SourceHashAlgorithm.Sha1);
779var text = SourceText.From("new text", encoding: null, SourceHashAlgorithm.Sha1);
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")));
866var text = SourceText.From(" ", encoding: null, SourceHashAlgorithm.Sha1);
918var text = SourceText.From("new text");
940var textAndVersion = TextAndVersion.Create(SourceText.From("new text"), VersionStamp.Default);
964var text = SourceText.From("new text");
986var textAndVersion = TextAndVersion.Create(SourceText.From("new text"), VersionStamp.Default);
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"));
1106loader: TextLoader.From(TextAndVersion.Create(SourceText.From("class NewD1;", Encoding.UTF32, SourceHashAlgorithm.Sha256), VersionStamp.Create(), filePath: Path.Combine(s_projectDir, "newD1.cs"))),
1115loader: TextLoader.From(TextAndVersion.Create(SourceText.From("class NewD3;", Encoding.UTF8, SourceHashAlgorithms.Default), VersionStamp.Create(), filePath: Path.Combine(s_projectDir, "newD3.cs"))),
1125loader: TextLoader.From(TextAndVersion.Create(SourceText.From("new text1", Encoding.UTF32, SourceHashAlgorithm.Sha256), VersionStamp.Create(), filePath: Path.Combine(s_projectDir, "newD1.cs"))),
1134loader: TextLoader.From(TextAndVersion.Create(SourceText.From("new text3", Encoding.UTF8, SourceHashAlgorithms.Default), VersionStamp.Create(), filePath: Path.Combine(s_projectDir, "newD3.cs"))),
1144loader: TextLoader.From(TextAndVersion.Create(SourceText.From("#new empty1", Encoding.UTF32, SourceHashAlgorithm.Sha256), VersionStamp.Create(), filePath: Path.Combine(s_projectDir, "newD1.cs"))),
1153loader: TextLoader.From(TextAndVersion.Create(SourceText.From("#new empty3", Encoding.UTF8, SourceHashAlgorithms.Default), VersionStamp.Create(), filePath: Path.Combine(s_projectDir, "newD3.cs"))),
1305var text = SourceText.From("class D;", Encoding.UTF8, SourceHashAlgorithms.Default);
1662var textC = SourceText.From("class C {}", encoding: null, checksumAlgorithm: SourceHashAlgorithm.Sha1);
2357var solution4 = solution3.AddAnalyzerConfigDocument(editorConfigId, ".editorconfig", SourceText.From(editorConfigContent), filePath: Path.Combine(s_projectDir, "subfolder", ".editorconfig"));
2468var sourceText = SourceText.From("text", checksumAlgorithm: SourceHashAlgorithms.Default);
2552var root = CSharp.SyntaxFactory.ParseSyntaxTree(SourceText.From("class C {}", encoding: Encoding.ASCII, SourceHashAlgorithm.Sha1)).GetRoot();
3235.AddDocument(documentId, "DocumentName", SourceText.From("class Class{}"));
3851.AddDocument(did, "test", SourceText.From(language == LanguageNames.CSharp ? "class C {}" : "Class C : End Class", Encoding.UTF8, SourceHashAlgorithm.Sha256), filePath: "old path");
4064var solution2 = solution.WithDocumentText(did3, SourceText.From(text4));
4077var doc = ws.AddDocument(proj.Id, "a.cs", SourceText.From("public class c { }", Encoding.UTF32));
4142workspace.AddDocument(project1.Id, "Broken.cs", SourceText.From("class "));
4164project = project.AddDocument("Extra.cs", SourceText.From("class Extra { }")).Project;
4166var documentToFreeze = project.AddDocument("DocumentToFreeze.cs", SourceText.From(""));
4189project = project.AddDocument("Extra.cs", SourceText.From("class Extra { }")).Project;
4191var documentToFreeze = project.AddDocument("DocumentToFreeze.cs", SourceText.From(""));
4217project = project.AddDocument("Extra.cs", SourceText.From("class Extra { }")).Project;
4219var documentToFreezeOriginal = project.AddDocument("DocumentToFreeze.cs", SourceText.From("class DocumentToFreeze { void M() { } }"));
4223var solution = project.Solution.WithDocumentText(documentToFreezeOriginal.Id, SourceText.From("class DocumentToFreeze { void M() { /*no top level change*/ } }"));
4262project = project.AddDocument("Extra.cs", SourceText.From("class Extra { }")).Project;
4264var documentToFreezeOriginal = project.AddDocument("DocumentToFreeze.cs", SourceText.From("class DocumentToFreeze { void M() { } }"));
4268var solution = project.Solution.WithDocumentText(documentToFreezeOriginal.Id, SourceText.From("class DocumentToFreeze { void M() { } public void NewMethod() { } }"));
4330var document = workspace.AddDocument(project2.Id, "Test.cs", SourceText.From(""));
4434document = document.WithText(SourceText.From("// Source File with Changes"));
4460.WithDocumentText(documentId1, SourceText.From("// Document 1 Changed"))
4461.WithDocumentText(documentId2, SourceText.From("// Document 2 Changed"))
4462.WithDocumentText(documentId3, SourceText.From("// Document 3 Changed"));
4647var text = SourceText.From("// empty", encoding: null, SourceHashAlgorithms.Default);
4762loader: TextLoader.From(TextAndVersion.Create(SourceText.From("[*.*]\r\n\r\ndotnet_diagnostic.CA1234.severity = error"), VersionStamp.Default)))));
4795loader: TextLoader.From(TextAndVersion.Create(SourceText.From("[*.*]\r\n\r\ndotnet_diagnostic.CA1234.severity = error"), VersionStamp.Default)))));
4836loader: TextLoader.From(TextAndVersion.Create(SourceText.From("[*.*]\r\n\r\ndotnet_diagnostic.CA1234.severity = error"), VersionStamp.Default)))));
4848TextLoader.From(TextAndVersion.Create(SourceText.From("[*.*]\r\n\r\ndotnet_diagnostic.CA6789.severity = error"), VersionStamp.Default)),
4884loader: TextLoader.From(TextAndVersion.Create(SourceText.From("is_global = true\r\n\r\ndotnet_diagnostic.CA1234.severity = error"), VersionStamp.Default)))));
4930loader: TextLoader.From(TextAndVersion.Create(SourceText.From("[*.*]\r\n\r\ngenerated_code = true"), VersionStamp.Default)))));
5512var text = SourceText.From("public class C { }");
5560var sourceTextToRelease = ObjectReference.CreateFromFactory(static () => SourceText.From(Guid.NewGuid().ToString()));
5608.AddDocument(documentId, "test.cs", SourceText.From("public class C { }"), filePath: sourcePath)
5609.AddAnalyzerConfigDocument(DocumentId.CreateNewId(projectId), ".editorconfig", SourceText.From($"[{pattern}]\nindent_style = tab"), filePath: configPath);
5669project = project.AddDocument("Extra.cs", SourceText.From("class Extra { }")).Project;
5686project = project.AddDocument("Extra.cs", SourceText.From("class Extra { }")).Project;
5707project1 = project2.Solution.GetProject(project1.Id).AddDocument("Doc1", SourceText.From("class Doc1 { }")).Project;
5708project2 = project1.Solution.GetProject(project2.Id).AddDocument("Doc2", SourceText.From("class Doc2 { }")).Project;
5735project1 = project2.Solution.GetProject(project1.Id).AddDocument("Doc1", SourceText.From("class Doc1 { }")).Project;
5736project2 = project1.Solution.GetProject(project2.Id).AddDocument("Doc2", SourceText.From("class Doc2 { }")).Project;
5765project1 = project2.Solution.GetProject(project1.Id).AddDocument("Doc1", SourceText.From("class Doc1 { }")).Project;
5766project2 = project1.Solution.GetProject(project2.Id).AddDocument("Doc2", SourceText.From("class Doc2 { }")).Project;
5797project1 = project1.AddDocument("Doc1", SourceText.From("class Doc1 { }")).Project;
5806var forkedProject1 = frozenSolution.WithDocumentText(project1.Documents.Single().Id, SourceText.From("class Doc2 { }")).GetProject(project1.Id);
5825project1 = project1.AddDocument("Doc1", SourceText.From("class Doc1 { }")).Project;
5845var forkedProject1 = frozenSolution.WithDocumentText(project1.Documents.Single().Id, SourceText.From("class Doc2 { }")).GetProject(project1.Id);
5874project = project.AddDocument("Extra.ts", SourceText.From("class Extra { }")).Project;
5897.AddDocument($"Document", SourceText.From("class C { }"), filePath: @"c:\test\Document.cs").Project;
5907.AddDocument($"Document", SourceText.From("class C { }"), filePath: @"c:\test\Document.cs").Project;
5918old => old.WithDocumentText(documentId1, SourceText.From(lastContents)),
SolutionTests\SolutionWithSourceGeneratorTests.cs (33)
206project = project.AdditionalDocuments.First().WithAdditionalDocumentText(SourceText.From("Changed text!")).Project;
230project = project.AddDocument("Source.cs", SourceText.From("")).Project;
263project = project.Solution.WithDocumentText(documentId, SourceText.From("// Changed Source File")).Projects.Single();
306project = project.Solution.WithAdditionalDocumentText(additionalDocumentId, SourceText.From("Hello, everyone!")).Projects.Single();
311project = project.Solution.WithAdditionalDocumentText(additionalDocumentId, SourceText.From("Good evening, everyone!")).Projects.Single();
375SourceText.From("Hello, world!!!!")).Projects.Single();
489project = project.Documents.Single().WithText(SourceText.From("// Change")).Project;
595var differentOpenTextContainer = SourceText.From("// Open Text").Container;
619var differentOpenTextContainer = SourceText.From("// StaticContent", Encoding.UTF8).Container;
634.AddAdditionalDocument("Test.txt", SourceText.From(""));
639var differentOpenTextContainer = SourceText.From("// Open Text").Container;
670var differentOpenTextContainer = SourceText.From("// Open Text").Container;
697var differentOpenTextContainer = SourceText.From("// Open Text").Container;
734documentToFreeze = documentToFreeze.WithText(SourceText.From("// Changed Source File"));
764document = document.WithText(SourceText.From("// Something else"));
793document = document.WithText(SourceText.From("// Something else"));
827document = document.WithText(SourceText.From("// Something else"));
888identity, DateTime.Now, SourceText.From("// Frozen Document"));
915[(sourceGeneratedDocument1.Identity, DateTime.Now, SourceText.From("// Frozen 1")), (sourceGeneratedDocument2.Identity, DateTime.Now, SourceText.From("// Frozen 2"))]);
935sourceGeneratedDocumentIdentity, sourceGeneratedDocument.GenerationDateTime, SourceText.From("// Hello, World"));
999[(ordinaryDocument.Id, SourceText.From("// Regular modified")),
1000(sourceGeneratedDocument.Id, SourceText.From("// Source gen modified"))]);
1154sourceGeneratedDocument = sourceGeneratedDocument.WithText(SourceText.From("// Something else"));
1182sourceGeneratedDocument = sourceGeneratedDocument.WithText(SourceText.From("// Something else"));
1186sourceGeneratedDocument = sourceGeneratedDocument.WithText(SourceText.From("// Thrice is nice"));
1218var solution = sourceGeneratedDocument1.WithText(SourceText.From("// Change doc 1")).Project.Solution;
1225solution = sourceGeneratedDocument2!.WithText(SourceText.From("// Change doc 2")).Project.Solution;
1267newDocument = newDocument.WithText(SourceText.From("// Changed frozen document"));
1276identity, DateTime.Now, SourceText.From("// Frozen Document"));
1313identity, DateTime.Now, SourceText.From("// Frozen Document"));
1344identity, DateTime.Now, SourceText.From("// Frozen Document"));
1379identity, DateTime.Now, SourceText.From("// Frozen Document"));
WorkspaceTests\AdhocWorkspaceTests.cs (13)
73var doc = ws.AddDocument(project.Id, name, SourceText.From(source));
155loader: TextLoader.From(TextAndVersion.Create(SourceText.From(""), VersionStamp.Create())));
213var text = SourceText.From("public class C { }");
247var text = SourceText.From("public class C { }");
281var text = SourceText.From("public class C { }");
320var text = SourceText.From("public class C { }");
378var docid1 = ws.AddDocument(projid, "A.cs", SourceText.From("public class A { }")).Id;
379var docid2 = ws.AddDocument(projid, "B.cs", SourceText.From("public class B { }")).Id;
415var originalDoc = ws.AddDocument(projectId, "TestDocument", SourceText.From(""));
446var originalDoc = ws.AddDocument(projectId, "TestDocument", SourceText.From(""));
482var originalDoc = ws.AddDocument(projectId, "TestDocument", SourceText.From(""));
514var originalDoc = ws.AddDocument(projectId, "TestDocument", SourceText.From(""));
545var originalDoc = ws.AddDocument(projectId, "TestDocument", SourceText.From(""));
WorkspaceTests\WorkspaceTests.cs (6)
25var originalDoc = ws.AddDocument(projectId, "TestDocument", SourceText.From(""));
27var changedDoc = originalDoc.WithText(SourceText.From("new"));
38var originalDoc = ws.AddDocument(projectId, "TestDocument", SourceText.From(""));
54var originalDoc = ws.AddDocument(projectId, "TestDocument", SourceText.From(""));
73var originalDoc = ws.AddDocument(projectId, "TestDocument", SourceText.From(""));
90var originalDoc = ws.AddDocument(projectId, "TestDocument", SourceText.From(""));
Microsoft.Extensions.Logging.Generators (1)
Microsoft.Extensions.Options.SourceGeneration (1)
Microsoft.Extensions.Validation.ValidationsGenerator (1)
Microsoft.Gen.BuildMetadata (1)
Microsoft.Gen.BuildMetadata.Unit.Tests (1)
Microsoft.Gen.ComplianceReports.Unit.Tests (1)
Microsoft.Gen.ContextualOptions.Unit.Tests (1)
Microsoft.Gen.Logging (1)
Microsoft.Gen.Logging.Unit.Tests (1)
Microsoft.Gen.MetadataExtractor.Unit.Tests (1)
Microsoft.Gen.Metrics (2)
Microsoft.Gen.Metrics.Unit.Tests (1)
Microsoft.Gen.MetricsReports.Unit.Tests (1)
Microsoft.Maui.Controls.SourceGen (3)
Microsoft.ML.AutoML.SourceGenerator (3)
Microsoft.VisualStudio.LanguageServices (1)
Microsoft.VisualStudio.LanguageServices.CSharp (2)
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (2)
Microsoft.VisualStudio.LanguageServices.Implementation (2)
Microsoft.VisualStudio.LanguageServices.LiveShare (2)
Roslyn.Diagnostics.Analyzers (3)
Roslyn.Diagnostics.CSharp.Analyzers (1)
Roslyn.VisualStudio.Next.UnitTests (70)
Remote\SnapshotSerializationTests.cs (9)
50var document1 = project1.AddDocument("Document1", SourceText.From(csCode));
54var document2 = project2.AddDocument("Document2", SourceText.From(vbCode));
60.AddAdditionalDocument("Additional", SourceText.From("hello"), ["test"], @".\Add").Project.Solution;
67loader: TextLoader.From(TextAndVersion.Create(SourceText.From("root = true"), VersionStamp.Create())))]);
153var document = workspace.CurrentSolution.AddProject("Project", "Project.dll", LanguageNames.CSharp).AddDocument("Document", SourceText.From(code));
173var document = solution.AddProject("Project", "Project.dll", LanguageNames.CSharp).AddDocument("Document", SourceText.From(code));
532var document = CreateWorkspace().CurrentSolution.AddProject("empty", "empty", LanguageNames.CSharp).AddDocument("empty", SourceText.From(""));
609var sourceText = SourceText.From("Hello", Encoding.UTF8);
627sourceText = SourceText.From("Hello", new NotSerializableEncoding());
Services\ServiceHubServicesTests.cs (44)
453var tempDoc = project.AddDocument("X.cs", SourceText.From("// "));
468Assert.True(localWorkspace.SetCurrentSolution(s => s.WithDocumentText(tempDocId, SourceText.From("// " + i)), WorkspaceChangeKind.SolutionChanged));
514=> SourceText.From(content, encoding ?? Encoding.UTF8, checksumAlgorithm);
721return ImmutableArray.Create(("hint", SourceText.From($"// generated document {callCount}", Encoding.UTF8)));
743solution = solution.WithTextDocumentText(tempDocId, SourceText.From("// new contents"));
776var tempDoc = project.AddDocument("X.cs", SourceText.From("// "));
805return ImmutableArray.Create(("hint", SourceText.From($"// generated document {callCount}", Encoding.UTF8)));
860return ImmutableArray.Create(("hint", SourceText.From($"// generated document {callCount}", Encoding.UTF8)));
914var tempDoc = project1.AddDocument("X.cs", SourceText.From("// "));
923var tempDoc = project2.AddDocument("X.cs", SourceText.From("// "));
965var tempDoc = project1.AddDocument("X.cs", SourceText.From("// "));
974var tempDoc = project2.AddDocument("X.cs", SourceText.From("// "));
1006var tempDoc = project1.AddDocument("X.cs", SourceText.From("// "));
1015var tempDoc = project2.AddDocument("X.cs", SourceText.From("// "));
1049var tempDoc = project1.AddDocument("X.cs", SourceText.From("// "));
1058var tempDoc = project2.AddDocument("X.cs", SourceText.From("// "));
1101var tempDoc = project1.AddDocument("X.cs", SourceText.From("// "));
1111var tempDoc = project2.AddDocument("X.cs", SourceText.From("// "));
1154var tempDoc = project1.AddDocument("X.cs", SourceText.From("// "));
1164var tempDoc = project2.AddDocument("X.cs", SourceText.From("// "));
1207var tempDoc = project1.AddDocument("X.cs", SourceText.From("// "));
1217var tempDoc = project2.AddDocument("X.cs", SourceText.From("// "));
1252var tempDoc = project1.AddDocument("X.cs", SourceText.From("// "));
1262var tempDoc = project2.AddDocument("X.cs", SourceText.From("// "));
1297var tempDoc = project1.AddDocument("X.cs", SourceText.From("// "));
1306var tempDoc = project2.AddDocument("X.cs", SourceText.From("// "));
1340var tempDoc = project1.AddDocument("X.cs", SourceText.From("// "));
1349var tempDoc = project2.AddDocument("X.cs", SourceText.From("// "));
1454Contract.ThrowIfFalse(workspace.TryApplyChanges(workspace.CurrentSolution.WithDocumentText(normalDocId, SourceText.From("// new text"))));
1514var tempDoc = project.AddDocument("X.cs", SourceText.From("// "));
1526Contract.ThrowIfFalse(workspace.TryApplyChanges(workspace.CurrentSolution.WithDocumentText(tempDoc.Id, SourceText.From("// new text"))));
1540Contract.ThrowIfFalse(workspace.TryApplyChanges(workspace.CurrentSolution.WithDocumentText(tempDoc.Id, SourceText.From("// more new text"))));
1598var tempDoc = project.AddDocument("X.cs", SourceText.From("// "));
1610Contract.ThrowIfFalse(workspace.TryApplyChanges(workspace.CurrentSolution.WithDocumentText(tempDoc.Id, SourceText.From("// new text"))));
1632Contract.ThrowIfFalse(workspace.TryApplyChanges(workspace.CurrentSolution.WithDocumentText(tempDoc.Id, SourceText.From("// more new text"))));
1677var tempDoc = project.AddDocument("X.cs", SourceText.From("// "));
1689Contract.ThrowIfFalse(workspace.TryApplyChanges(workspace.CurrentSolution.WithDocumentText(tempDoc.Id, SourceText.From("// new text"))));
1716Contract.ThrowIfFalse(workspace.TryApplyChanges(workspace.CurrentSolution.WithDocumentText(tempDoc.Id, SourceText.From("// more new text"))));
1761var tempDoc = project.AddDocument("X.cs", SourceText.From("// "));
1881var tempDoc = project1.AddDocument("X.cs", SourceText.From("// "));
2056return SourceText.From(document.State.GetTextSynchronously(CancellationToken.None).ToString() + csAddition);
2059return SourceText.From(document.State.GetTextSynchronously(CancellationToken.None).ToString() + vbAddition);
2171solution = current.AddDocument($"Document{i}", SourceText.From(documents[i])).Project.Solution;
2177solution = current.AddAdditionalDocument($"AdditionalDocument{i}", SourceText.From(additionalDocuments[i])).Project.Solution;
Services\SolutionServiceTests.cs (16)
159await VerifySolutionUpdate(code, s => s.WithDocumentText(s.Projects.First().DocumentIds.First(), SourceText.From(code + " ")));
307project = project.AddDocument("newDocument", SourceText.From("// new text")).Project;
326loader: TextLoader.From(TextAndVersion.Create(SourceText.From("test"), VersionStamp.Create())));
337return s.WithAdditionalDocumentText(additionalDocumentId, SourceText.From("changed"));
358loader: TextLoader.From(TextAndVersion.Create(SourceText.From("root = true"), VersionStamp.Create(), filePath: configPath)),
370return s.WithAnalyzerConfigDocumentText(analyzerConfigDocumentId, SourceText.From("root = false"));
390loader: TextLoader.From(TextAndVersion.Create(SourceText.From("class A { }"), VersionStamp.Create())));
401return s.WithDocumentText(documentId, SourceText.From("class Changed { }"));
428var currentSolution = remoteSolution1.WithDocumentText(remoteSolution1.Projects.First().Documents.First().Id, SourceText.From(code + " class Test2 { }"));
437currentSolution = oopSolution2.WithDocumentText(oopSolution2.Projects.First().Documents.First().Id, SourceText.From(code + " class Test3 { }"));
513var frozenText1 = SourceText.From("// Hello, World!");
522var frozenText2 = SourceText.From("// Hello, World! A second time!");
826solution = solution.GetProject(project1.Id).AddDocument("X.cs", SourceText.From("// X")).Project.Solution;
827solution = solution.GetProject(project2.Id).AddDocument("Y.vb", SourceText.From("' Y")).Project.Solution;
881solution = solution.GetProject(project1.Id).AddDocument("X.cs", SourceText.From("// X")).Project.Solution;
882solution = solution.GetProject(project2.Id).AddDocument("Y.cs", SourceText.From("// Y")).Project.Solution;
StackDepthTest (1)
System.Private.CoreLib.Generators (1)
System.Text.Json.SourceGeneration (1)
System.Windows.Forms.Analyzers.CSharp.Tests (1)
System.Windows.Forms.Analyzers.Tests (6)
Test.Utilities (4)
Text.Analyzers (4)
Text.Analyzers.UnitTests (1)