916 references to Path
InteractiveHost.UnitTests (37)
AbstractInteractiveHostTests.cs (1)
206return (file.Path, image);
InteractiveHostCoreInitTests.cs (2)
57var dllDir = Path.GetDirectoryName(dll.Path)!; 85await Host.AddReferenceAsync(Path.GetFileName(dll.Path));
InteractiveHostDesktopInitTests.cs (2)
30var dllDir = Path.GetDirectoryName(dll.Path)!; 58await Host.AddReferenceAsync(Path.GetFileName(dll.Path));
InteractiveHostDesktopTests.cs (32)
182var file = Temp.CreateFile().WriteAllText(MethodWithInfiniteLoop + "\r\nfoo();").Path; 201var file = Temp.CreateFile().WriteAllText("1 1").Path; 236").Path; 272await Host.ExecuteFileAsync(file.Path); 275Assert.True(errorOut.StartsWith(file.Path + "(1,7):", StringComparison.Ordinal), "Error output should start with file name, line and column"); 463Assert.True(await LoadReference(file1.Path)); 464Assert.True(await LoadReference(file2.Path)); 508#r ""{file.Path}"" 520#r ""{file.Path}"" 551#r ""{file1.Path}"" 552#r ""{file2.Path}"" 562Assert.Equal(@"(2,1): error CS1704: An assembly with the same simple name 'C' has already been imported. Try removing one of the references (e.g. '" + file1.Path + @"') or sign them to enable side-by-side. 586#r ""{file1.Path}"" 587#r ""{file2.Path}"" 704rspFile.WriteAllText($"/lib:{directory1.Path} /r:Assembly2.dll {initFile.Path}"); 706await Host.ResetAsync(new InteractiveHostOptions(Host.OptionsOpt!.HostPath, rspFile.Path, CultureInfo.InvariantCulture, CultureInfo.InvariantCulture, Host.OptionsOpt!.Platform)); 722{string.Format(InteractiveHostResources.Loading_context_from_0, Path.GetFileName(rspFile.Path))} 742rspFile.WriteAllText($"{initFile.Path}"); 744await Host.ResetAsync(new InteractiveHostOptions(Host.OptionsOpt!.HostPath, rspFile.Path, CultureInfo.InvariantCulture, CultureInfo.InvariantCulture, Host.OptionsOpt!.Platform)); 748@$"{initFile.Path}(1,1): error CS0006: {string.Format(CSharpResources.ERR_NoMetadataFile, "Assembly.dll")}", error); 769await Host.ResetAsync(new InteractiveHostOptions(Host.OptionsOpt!.HostPath, rspFile.Path, CultureInfo.InvariantCulture, CultureInfo.InvariantCulture, Host.OptionsOpt!.Platform)); 802$@"{string.Format(InteractiveHostResources.Loading_context_from_0, Path.GetFileName(rspFile.Path))} 817{initFile.Path} 820await Host.ResetAsync(new InteractiveHostOptions(Host.OptionsOpt!.HostPath, rspFile.Path, CultureInfo.InvariantCulture, CultureInfo.InvariantCulture, Host.OptionsOpt!.Platform)); 826AssertEx.AssertEqualToleratingWhitespaceDifferences($@"{initFile.Path}(1,3): error CS1002: {CSharpResources.ERR_SemicolonExpected} 830{string.Format(InteractiveHostResources.Loading_context_from_0, Path.GetFileName(rspFile.Path))} 847await Host.ResetAsync(new InteractiveHostOptions(Host.OptionsOpt!.HostPath, rspFile.Path, CultureInfo.InvariantCulture, CultureInfo.InvariantCulture, Host.OptionsOpt!.Platform)); 852$@"{string.Format(InteractiveHostResources.Loading_context_from_0, Path.GetFileName(rspFile.Path))} 915#r """ + dll.Path + @""" 944await Execute($@"#r ""{libFile.Path}"""); 1027await Host.ResetAsync(new InteractiveHostOptions(Host.OptionsOpt!.HostPath, rspFile.Path, culture, uiCulture, Host.OptionsOpt!.Platform)); 1037{string.Format(InteractiveHostResources.Loading_context_from_0, Path.GetFileName(rspFile.Path))}
Microsoft.Build.Tasks.CodeAnalysis.UnitTests (32)
CopyRefAssemblyTests.cs (22)
47File.WriteAllText(file.Path, ""); 52SourcePath = file.Path, 65File.WriteAllText(file.Path, "test"); 71SourcePath = file.Path, 76AssertEx.AssertEqualToleratingWhitespaceDifferences($$"""Copying reference assembly from "{{file.Path}}" to "{{dest}}".""", engine.Log); 85File.WriteAllText(source.Path, "test"); 87File.WriteAllText(dest.Path, "dest"); 92SourcePath = source.Path, 93DestinationPath = dest.Path, 99Could not extract the MVID from "{{source.Path}}". Are you sure it is a reference assembly? 100Copying reference assembly from "{{source.Path}}" to "{{dest}}". 104Assert.Equal("test", File.ReadAllText(dest.Path)); 112File.WriteAllBytes(source.Path, TestResources.General.MVID1); 113var sourceTimestamp = File.GetLastWriteTimeUtc(source.Path).ToString("O"); 116File.WriteAllBytes(dest.Path, TestResources.General.MVID2); 117var destTimestamp = File.GetLastWriteTimeUtc(dest.Path).ToString("O"); 123SourcePath = source.Path, 124DestinationPath = dest.Path, 130Source reference assembly "{{source.Path}}" (timestamp "{{sourceTimestamp}}", MVID "f851dda2-6ea3-475e-8c0d-19bd3c4d9437") differs from destination "{{dest.Path}}" (timestamp "{{destTimestamp}}", MVID "8e1ed25b-2980-4f32-9dee-c1e3b0a57c4b"). 131Copying reference assembly from "{{source.Path}}" to "{{dest.Path}}".
DotNetSdkTests.cs (6)
42<Compile Include=""{libFile.Path}"" Link=""Lib.cs"" /> 433editorConfigFile2.Path 494globalConfigFile.Path, 495globalConfigFile2.Path 561globalConfigFile.Path, 562globalConfigFile2.Path
IntegrationTests.cs (2)
98return ProcessUtilities.Run(file.Path, "", Path.GetDirectoryName(file.Path));
TestUtilities\DotNetSdkTestBase.cs (2)
191Project.Path, 233Project.Path,
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (93)
CommandLineIVTTests.cs (8)
38source2.Path, 44var outputFilePath = $"{Path.GetFileName(dir.Path)}{Path.DirectorySeparatorChar}{Path.GetFileName(source2.Path)}"; 115source2.Path, 121var outputFilePath = $"{Path.GetFileName(dir.Path)}{Path.DirectorySeparatorChar}{Path.GetFileName(source2.Path)}"; 194source2.Path, 200var outputFilePath = $"{Path.GetFileName(dir.Path)}{Path.DirectorySeparatorChar}{Path.GetFileName(source2.Path)}"; 279source2.Path, 285var outputFilePath = $"{Path.GetFileName(dir.Path)}{Path.DirectorySeparatorChar}{Path.GetFileName(source2.Path)}";
CommandLineTests.cs (59)
146var cmd = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/errorlog:errorlog", $"/doc:{docName}", "/warnaserror", src.Path }); 166var cmd = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/t:library", "/preferreduilang:en", $"/doc:{docName}", src.Path }); 199"/analyzerconfig:" + analyzerConfig.Path, 200src.Path }); 202Assert.Equal(analyzerConfig.Path, Assert.Single(cmd.Arguments.AnalyzerConfigPaths)); 242"/analyzerconfig:" + modifyPath(editorconfig.Path, doubleSlashAnalyzerConfig), 243modifyPath(src.Path, doubleSlashSource), 291"/analyzerconfig:" + analyzerConfig.Path, 294"/additionalfile:" + additionalFile.Path, 295src.Path }); 297Assert.Equal(analyzerConfig.Path, Assert.Single(cmd.Arguments.AnalyzerConfigPaths)); 344"/analyzerconfig:" + analyzerConfig.Path, 345src.Path }); 347Assert.Equal(analyzerConfig.Path, Assert.Single(cmd.Arguments.AnalyzerConfigPaths)); 353$@"warning InvalidSeverityInAnalyzerConfig: The diagnostic 'cs0169' was given an invalid severity 'garbage' in the analyzer config file at '{analyzerConfig.Path}'. 380"/analyzerconfig:" + analyzerConfig1.Path, 381"/analyzerconfig:" + analyzerConfig2.Path, 382src.Path 400var cmd = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", src.Path }); 420var cmd = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/codepage:932", src.Path }); 453").Path; 875string tmpFileName = Temp.CreateFile().WriteAllBytes(new byte[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }).Path; 1261CleanupAllGeneratedFiles(file1.Path); 1262CleanupAllGeneratedFiles(file2.Path); 1263CleanupAllGeneratedFiles(file3.Path); 1264CleanupAllGeneratedFiles(file4.Path); 1265CleanupAllGeneratedFiles(file5.Path); 2262AssertEx.Equal(File.ReadAllBytes(sl.Path), blob); 2267CleanupAllGeneratedFiles(src.Path); 2291AssertEx.Equal(File.ReadAllBytes(sl.Path), blob); 2295CleanupAllGeneratedFiles(src.Path); 2320CleanupAllGeneratedFiles(src.Path); 2440expectedEmbeddedMap.Add(src.Path, embed_cs); 2445expectedEmbeddedMap.Add(src2.Path, embed2_cs); 2450expectedEmbeddedMap.Add(txt.Path, embed_xyz); 2473CleanupAllGeneratedFiles(src.Path); 2838var parsedArgs = DefaultParse(new string[] { @"/ruleset:" + file.Path, "a.cs" }, WorkingDirectory); 2840Assert.Equal(expected: file.Path, actual: parsedArgs.RuleSetPath); 2864var parsedArgs = DefaultParse(new string[] { @"/ruleset:" + "\"" + file.Path + "\"", "a.cs" }, WorkingDirectory); 2866Assert.Equal(expected: file.Path, actual: parsedArgs.RuleSetPath); 2893parsedArgs = DefaultParse(new string[] { @"/ruleset:" + file.Path, "a.cs" }, WorkingDirectory); 2896Assert.Equal(expected: file.Path, actual: parsedArgs.RuleSetPath); 2901Assert.Equal(file.Path, (string)err.Arguments[0]); 2961var csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/preferreduilang:en", "/t:library", "/a:" + Assembly.GetExecutingAssembly().Location, "a.cs", "/ruleset:" + ruleSetFile.Path }); 2998"/ruleset:" + ruleSetFile.Path, "/warnaserror+", "/nowarn:8032" }); 3009"/warnaserror+", "/ruleset:" + ruleSetFile.Path, "/nowarn:8032" }); 3517"/ruleset:" + ruleSetFile.Path, "/warn:0" }); 3528"/warn:0", "/ruleset:" + ruleSetFile.Path }); 9314commandLineArgs = new[] { @"tmpDir\a.cs", tempFile.Path }; 9325commandLineArgs = new[] { tempFile.Path, @"tmpDir\*.cs" }; 9340commandLineArgs = new[] { "/preferreduilang:en", tempFile.Path, "tmpDir\a.cs" }; 9345commandLineArgs = new[] { tempFile.Path, @"tmpDi\r*a?.cs" }; 9354commandLineArgs = new[] { tempFile.Path, currentDrive + @":a.cs" }; 9360commandLineArgs = new[] { "/preferreduilang:en", tempFile.Path, @":a.cs" }; 9365CleanupAllGeneratedFiles(tempFile.Path); 10566sourceFile.Path 13423arguments = arguments.Append($"/ruleset:{rulesetFile.Path}"); 13571additionalArgs = additionalArgs.Append("/ruleset:" + rulesetFile.Path).ToArray(); 13888additionalFlags = additionalFlags.Append($"/analyzerconfig:{analyzerConfig.Path}").ToArray();
SarifErrorLoggerTests.cs (9)
41var hello = Temp.CreateFile().WriteAllText(helloWorldCS).Path; 72var sourceFile = Temp.CreateFile().WriteAllText(source).Path; 106var sourceFile = Temp.CreateFile().WriteAllText(source).Path; 138var sourceFile = Temp.CreateFile().WriteAllText(source).Path; 175var sourceFile = Temp.CreateFile().WriteAllText(source).Path; 210var sourceFile = Temp.CreateFile().WriteAllText(source).Path; 245var sourceFile = Temp.CreateFile().WriteAllText(source).Path; 280var sourceFile = Temp.CreateFile().WriteAllText(source).Path; 313var sourceFile = Temp.CreateFile().WriteAllText(source).Path;
SarifV2ErrorLoggerTests.cs (7)
445var sourceFile = Temp.CreateFile().WriteAllText(source).Path; 525var sourceFile1 = sourceDir.CreateFile("source1.cs").WriteAllText(source1).Path; 526var sourceFile2 = sourceDir.CreateFile("source2.cs").WriteAllText(source2).Path; 527var editorconfigFile = sourceDir.CreateFile(".editorconfig").WriteAllText(editorconfigText).Path; 597var sourceFile = Temp.CreateFile().WriteAllText(source).Path; 681string[] arguments = new[] { "/nologo", sourceFile.Path, "/preferreduilang:en", $"/errorlog:{errorLogFile}{GetErrorLogQualifier(version)}" }; 748CleanupAllGeneratedFiles(sourceFile.Path);
TouchedFileLoggingTests.cs (10)
38var hello = Temp.CreateFile().WriteAllText(helloWorldCS).Path; 66var hello = Temp.CreateFile().WriteAllText(helloWorldCS).Path; 77</configuration>").Path; 79var silverlight = Temp.CreateFile().WriteAllBytes(Silverlight.System).Path; 80var net4_0dll = Temp.CreateFile().WriteAllBytes(Net461.Resources.System).Path; 112var hello = Temp.CreateFile().WriteAllText(helloWorldCS).Path; 113var snkPath = Temp.CreateFile("TestKeyPair_", ".snk").WriteAllBytes(TestResources.General.snKey).Path; 151public class C { }").Path; 160"/doc:" + xml.Path, 172expectedWrites.Add(xml.Path);
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (6)
Emit\CompilationEmitTests.cs (1)
1999options: TestOptions.ReleaseDll.WithCryptoKeyFile(snk.Path).WithPublicSign(true));
Emit\ResourceTests.cs (5)
58lib = LoadLibraryEx(exe.Path, IntPtr.Zero, 0x00000002); 119var fileVer = FileVersionInfo.GetVersionInfo(exe.Path); 148lib = LoadLibraryEx(exe.Path, IntPtr.Zero, 0x00000002); 201var fileVer = FileVersionInfo.GetVersionInfo(exe.Path); 847lib = LoadLibraryEx(exeFile.Path, IntPtr.Zero, 0x00000002);
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (10)
Attributes\EmitTestStrongNameProvider.cs (1)
32var keyFile = Temp.CreateFile().WriteAllBytes(TestResources.General.snKey).Path;
Attributes\InternalsVisibleToAndStrongNameTests.cs (9)
383CSharpCompilation other = CreateCompilation(s, options: TestOptions.ReleaseDll.WithCryptoKeyFile(tempFile.Path), parseOptions: parseOptions); 537[assembly: System.Reflection.AssemblyKeyFile(@""" + snk.Path + @""")] 541c = CreateCompilation(source1, options: TestOptions.SigningReleaseModule.WithCryptoKeyFile(snk.Path).WithPublicSign(true)); 610.WithCryptoKeyFile(snk.Path) 632.WithCryptoKeyFile(pubKeyFile.Path) 656.WithCryptoKeyFile(pubKeyFile.Path) 721.WithCryptoKeyFile(snk.Path), 742.WithCryptoKeyFile(snk.Path), 1517using (var metadata = new FileStream(file.Path, FileMode.Open))
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (1)
EditAndContinue\StatementEditingTests.cs (1)
3724delegateDefs = MetadataReference.CreateFromImage(File.ReadAllBytes(tempAssembly.Path));
Microsoft.CodeAnalysis.CSharp.Scripting.Desktop.UnitTests (31)
InteractiveSessionReferencesTests.cs (31)
347#r ""{c1.Path}"" 348#r ""{c2.Path}"" 363#r ""{c1.Path}"" 365#r ""{c2.Path}"" 383#r ""{c1.Path}"" 384#r ""{c2.Path}"" 402#r ""{c1.Path}"" 404#r ""{c2.Path}"" 422#r ""{c1.Path}"" 430#r ""{c2.Path}"" 448Diagnostic(ErrorCode.ERR_NoImplicitConv, "c2").WithArguments($"C [{c2.Path}]", $"C [{c1.Path}]")); 632var s0 = await CSharpScript.RunAsync($@"#r ""{file1.Path}""", ScriptOptions); 634var s2 = await s1.ContinueWithAsync($@"#r ""{file2.Path}"""); 646Assert.Equal(fileBase1.Path, ((PortableExecutableReference)libBaseRefAndSymbol.Key).FilePath); 690var s0 = await CSharpScript.RunAsync($@"#r ""{file1.Path}""", ScriptOptions); 692var s2 = await s1.ContinueWithAsync($@"#r ""{file2.Path}"""); 704Assert.Equal(fileBase1.Path, ((PortableExecutableReference)libBaseRefAndSymbol.Key).FilePath); 756var s0 = await CSharpScript.RunAsync($@"#r ""{file1.Path}""", ScriptOptions); 758var s2 = await s1.ContinueWithAsync($@"#r ""{file2.Path}"""); 824var s0 = await CSharpScript.RunAsync($@"#r ""{file1.Path}""", ScriptOptions); 826var s2 = await s1.ContinueWithAsync($@"#r ""{file2.Path}"""); 892var s0 = await CSharpScript.RunAsync($@"#r ""{file1.Path}""", ScriptOptions); 894var s2 = await s1.ContinueWithAsync($@"#r ""{file2.Path}"""); 960var s0 = await CSharpScript.RunAsync($@"#r ""{file1.Path}""", ScriptOptions); 962var s2 = await s1.ContinueWithAsync($@"#r ""{file2.Path}"""); 1028var s0 = await CSharpScript.RunAsync($@"#r ""{file1.Path}""", ScriptOptions); 1030var s2 = await s1.ContinueWithAsync($@"#r ""{file2.Path}"""); 1096var s0 = await CSharpScript.RunAsync($@"#r ""{file1.Path}""", ScriptOptions); 1099var s2 = await s1.ContinueWithAsync($@"#r ""{file2.Path}"""); 1122var s0 = await CSharpScript.RunAsync("C c;", ScriptOptions.WithReferences(libFile.Path));
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests (43)
CommandLineRunnerTests.cs (22)
269""{script.Path}"" 276args: [$@"@""{rsp.Path}""", "/arg5", "--", "/arg7"], 300args: [script.Path, "arg1", "arg2", "arg3"]); 317args: [script.Path, "@arg1", "@arg2", "@arg3"]); 335{script.Path} 343args: [$"@{rsp.Path}", "/arg5", "--", "/arg7"], 366args: ["--", script.Path, "@arg1", "@arg2", "@arg3"]); 452script.Path 543var runner = CreateRunner([$"/loadpath:{dir1.Path}", $"/loadpaths:{dir2.Path};{dir3.Path}", main.Path]); 580var runner = CreateRunner(["/r:4.dll", $"/lib:{dir1.Path}", $"/libpath:{dir2.Path}", $"/libpaths:{dir3.Path};{dir4.Path}", main.Path]); 680var csi = CreateRunner(["b.csx"], responseFile: rsp.Path); 709var runner = CreateRunner(["/i", init.Path], input: 729var runner = CreateRunner([$@"/r:""{reference.Path}""", "/i", init.Path], input: 736{init.Path}(2,3): error CS1002: {CSharpResources.ERR_SemicolonExpected} 744$@"{init.Path}(2,3): error CS1002: {CSharpResources.ERR_SemicolonExpected}", 836$@"#r ""{file1.Path}"" 838#r ""{file2.Path}"" 845> #r ""{file1.Path}"" 847> #r ""{file2.Path}"" 850{string.Format(ScriptingResources.AssemblyAlreadyLoaded, libBaseName, "0.0.0.0", fileBase1.Path, fileBase2.Path)}
InteractiveSessionReferencesTests.cs (9)
42#r ""{libFile.Path}"" 88var libDRef = MetadataReference.CreateFromFile(libDFile.Path); 96var r1 = swapReferences ? libBFile.Path : libAFile.Path; 97var r2 = swapReferences ? libAFile.Path : libBFile.Path; 133var libBRef = MetadataReference.CreateFromFile(libBFile.Path); 139#r ""{libAFile.Path}"" 145File.Move(libBFile.Path, Path.Combine(dir.Path, "libB.dll"));
InteractiveSessionTests.cs (12)
1213lib1.Emit(file1.Path); 1221lib2.Emit(file2.Path); 1224#r ""{file1.Path}"" 1225#r ""{file2.Path}"" 1236lib.Emit(file.Path); 1238string dir = Path.Combine(Path.GetDirectoryName(file.Path), "subdir"); 1239string libFileName = Path.GetFileName(file.Path); 1254lib.Emit(file.Path); 1256string root = Path.GetPathRoot(file.Path); 1257string unrooted = file.Path[root.Length..]; 1295var r2 = CSharpScript.Create($@"#r ""{fileMain.Path}""", ScriptOptions).ContinueWith($@"M.X.F").RunAsync().Result.ReturnValue; 1326var r2 = CSharpScript.Create($@"#r ""{fileMain.Path}""", ScriptOptions).ContinueWith($@"M.X.F").RunAsync().Result.ReturnValue;
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (1)
Semantics\SemanticErrorTests.cs (1)
21974var comp = CreateCompilationWithMscorlib40AndDocumentationComments(string.Format(sourceTemplate, xmlFile.Path));
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (76)
Compilation\GetUnusedImportDirectivesTests.cs (1)
212var snkPath = Temp.CreateFile().WriteAllBytes(TestResources.General.snKey).Path;
Compilation\ReferenceManagerTests.cs (10)
852string p1 = Temp.CreateFile().WriteAllBytes(TestResources.General.MDTestLib1).Path; 924string p1 = dir.CreateFile("netModule1.netmodule").WriteAllBytes(TestResources.SymbolsTests.netModule.netModule1).Path; 993string p1 = Temp.CreateFile().WriteAllBytes(Net461.Resources.SystemCore).Path; 994string p2 = Temp.CreateFile().CopyContentFrom(p1).Path; 1013var p1 = Temp.CreateFile().WriteAllBytes(Net461.Resources.System).Path; 1014var p2 = Temp.CreateFile().WriteAllBytes(Net20.Resources.System).Path; 1043var ref1 = AssemblyMetadata.CreateFromFile(exe1.Path).GetReference(aliases: ImmutableArray.Create("A1")); 1044var ref2 = AssemblyMetadata.CreateFromFile(exe2.Path).GetReference(aliases: ImmutableArray.Create("A2")); 1270var path1 = Temp.CreateFile().WriteAllBytes(TestResources.General.MDTestLib1).Path; 1271var path2 = Temp.CreateFile().WriteAllBytes(TestResources.General.MDTestLib2).Path;
DocumentationComments\DocumentationCommentCompilerTests.cs (51)
3442string xmlFilePath = xmlFile.Path; 3477string xmlFilePath = xmlFile.Path; 3515string xmlFilePath = xmlFile.Path; 3550string xmlFilePath = xmlFile.Path; 3586string xmlFilePath = xmlFile.Path; 3740var comp = CreateCompilationUtil(string.Format(sourceTemplate, xmlFile.Path)); 3811var comp = CreateCompilationUtil(string.Format(sourceTemplate, xmlFile.Path)); 3837var xmlFilePath = xmlFile.Path; 3874var xmlFilePath1 = xmlFile1.Path; 3877var xmlFilePath2 = xmlFile2.Path; 3910var xmlFilePath = xmlFile.Path; 3944var xmlFilePath1 = xmlFile1.Path; 3947var xmlFilePath2 = xmlFile2.Path; 3977var xmlFilePath = xmlFile.Path; 4011var xmlFilePath1 = xmlFile1.Path; 4014var xmlFilePath2 = xmlFile2.Path; 4044var xmlFilePath = xmlFile.Path; 4076var xmlFilePath = xmlFile.Path; 4110var xmlFilePath = xmlFile.Path; 4164var xmlFilePath = xmlFile.Path; 4203var xmlFilePath1 = xmlFile1.Path; 4206var xmlFilePath2 = xmlFile2.Path; 4242var xmlFilePath = xmlFile.Path; 4319var xmlFilePath = xmlFile.Path; 4354var xmlFilePath = xmlFile.Path; 4389var xmlFilePath = xmlFile.Path; 4436var xmlFilePath = xmlFile.Path; 4477var xmlFilePath = xmlFile.Path; 4531var xmlFilePath = xmlFile.Path; 4576var xmlFilePath = xmlFile.Path; 4653var xmlFilePath = xmlFile.Path; 4733var xmlFilePath = xmlFile.Path; 4804var xmlFilePath = xmlFile.Path; 4848var xmlFilePath = xmlFile.Path; 4886var xmlFilePath = xmlFile.Path; 4927var xmlFilePath = xmlFile.Path; 4963var xmlFilePath = xmlFile.Path; 5005var xmlFilePath = xmlFile.Path; 5075var xmlFilePath = xmlFile.Path; 5244var xmlFilePath = xmlFile.Path; 5964var comp = CreateCompilationUtil(string.Format(sourceTemplate, xmlFile.Path)); 5982Assert.Equal(string.Format(expectedTemplate, TestHelpers.AsXmlCommentText(xmlFile.Path)), actual); 7213var xmlFilePath = xmlFile.Path; 7303string fullPath = xmlFile.Path; 7327/// <include file='file://" + xmlFile.Path + @"' path='hello'/> 7334@"<include file='file://" + xmlFile.Path + @"' path='hello'/>"). 7335WithArguments("file://" + xmlFile.Path, "hello", "File not found.").WithLocation(2, 5)); 7345string xmlFilePath = Path.GetFileName(xmlFile.Path); 7346string dirPath = Path.GetDirectoryName(xmlFile.Path); 7397/// <include file='" + xmlFile.Path + @"' path='hello'/> 7445var xmlFilePath = xmlFile.Path;
DocumentationComments\DocumentationModeTests.cs (1)
369var xmlFilePath = xmlFile.Path;
Symbols\CompilationCreationTests.cs (9)
2677var data = Temp.CreateFile().WriteAllBytes(Net461.Resources.SystemData).Path; 2678var core = Temp.CreateFile().WriteAllBytes(Net461.Resources.SystemCore).Path; 2679var xml = Temp.CreateFile().WriteAllBytes(Net461.Resources.SystemXml).Path; 2680var system = Temp.CreateFile().WriteAllBytes(Net461.Resources.System).Path; 2722var data = Temp.CreateFile().WriteAllBytes(Net461.Resources.SystemData).Path; 2723var core = Temp.CreateFile().WriteAllBytes(Net461.Resources.SystemCore).Path; 2724var system = Temp.CreateFile().WriteAllBytes(Net461.Resources.System).Path; 2774var csClasses01 = Temp.CreateFile().WriteAllBytes(TestResources.MetadataTests.InterfaceAndClass.CSClasses01).Path; 2775var csInterfaces01 = Temp.CreateFile().WriteAllBytes(TestResources.MetadataTests.InterfaceAndClass.CSInterfaces01).Path;
Symbols\Metadata\PE\TypeForwarders.cs (2)
1562var result = ProcessUtilities.RunAndGetOutput(asmB.Path); 1570result = ProcessUtilities.RunAndGetOutput(asmB2.Path);
Symbols\SymbolErrorTests.cs (2)
7131ilBytes = ReadFromFile(reference.Path); 7200ilBytes = ReadFromFile(reference.Path);
Microsoft.CodeAnalysis.CSharp.Test.Utilities (1)
CSharpTestBase.cs (1)
1524return MetadataReference.CreateFromImage(ReadFromFile(tempAssembly.Path));
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (8)
EditAndContinue\EditAndContinueLanguageServiceTests.cs (5)
253loader: new WorkspaceFileTextLoader(workspace.Services.SolutionServices, sourceFile.Path, Encoding.UTF8), 254filePath: sourceFile.Path)); 259var moduleId = EmitAndLoadLibraryToDebuggee(source1, sourceFilePath: sourceFile.Path); 263File.WriteAllText(sourceFile.Path, source2, Encoding.UTF8); 276Assert.Equal(sourceFile.Path, key);
Emit\CompilationOutputFilesTests.cs (2)
40var outputs = new CompilationOutputFiles(dllFile.Path, pdbFile.Path);
Utilities\SymbolEquivalenceComparerTests.cs (1)
1828var bytes = File.ReadAllBytes(tempAssembly.Path);
Microsoft.CodeAnalysis.Features.UnitTests (48)
EditAndContinue\EditAndContinueWorkspaceServiceTests.cs (45)
67var sourceTreeA1 = SyntaxFactory.ParseSyntaxTree(SourceText.From(sourceBytesA1, sourceBytesA1.Length, encodingA, SourceHashAlgorithms.Default), TestOptions.Regular, sourceFileA.Path); 68var sourceTreeB1 = SyntaxFactory.ParseSyntaxTree(SourceText.From(sourceBytesB1, sourceBytesB1.Length, encodingB, SourceHashAlgorithms.Default), TestOptions.Regular, sourceFileB.Path); 69var sourceTreeC1 = SyntaxFactory.ParseSyntaxTree(SourceText.From(sourceBytesC1, sourceBytesC1.Length, encodingC, SourceHashAlgorithm.Sha1), TestOptions.Regular, sourceFileC.Path); 89loader: new WorkspaceFileTextLoader(solution.Services, sourceFileA.Path, encodingA), 90filePath: sourceFileA.Path)); 96loader: new WorkspaceFileTextLoader(solution.Services, sourceFileB.Path, encodingB), 97filePath: sourceFileB.Path)); 103loader: new WorkspaceFileTextLoader(solution.Services, sourceFileC.Path, encodingC), 104filePath: sourceFileC.Path)); 110loader: new WorkspaceFileTextLoader(solution.Services, sourceFileE.Path, encodingE), 111filePath: sourceFileE.Path)); 132filePath: sourceFileD.Path)); 150solution = solution.WithDocumentTextLoader(documentIdB, new WorkspaceFileTextLoader(solution.Services, sourceFileB.Path, encodingB), PreservationMode.PreserveValue); 157AssertEx.Equal([$"P.csproj: (0,0)-(0,0): Warning ENC1005: {string.Format(FeaturesResources.DocumentIsOutOfSyncWithDebuggee, sourceFileB.Path)}"], InspectDiagnostics(emitDiagnostics)); 201solution = solution.WithProjectOutputFilePath(document.Project.Id, moduleFile.Path); 202_mockCompilationOutputsProvider = _ => new CompilationOutputFiles(moduleFile.Path); 312solution = solution.WithProjectOutputFilePath(document1.Project.Id, moduleFile.Path).AddDocument(documentInfo); 314_mockCompilationOutputsProvider = _ => new CompilationOutputFiles(moduleFile.Path); 387var sourceFilePath = dir.CreateFile(sourceFileName).WriteAllText(source, Encoding.UTF8).Path; 485using var stream = File.OpenRead(moduleFile.Path); 500_mockCompilationOutputsProvider = _ => new CompilationOutputFiles(moduleFile.Path); 520AssertEx.Equal([$"proj.csproj: (0,0)-(0,0): Error ENC1001: {string.Format(FeaturesResources.ErrorReadingFile, moduleFile.Path, expectedErrorMessage)}"], InspectDiagnostics(emitDiagnostics)); 569AddDocument("a.cs", CreateText(source1), filePath: sourceFile.Path); 574var moduleId = EmitAndLoadLibraryToDebuggee(source1, sourceFilePath: sourceFile.Path); 599AssertEx.Equal([$"proj.csproj: (0,0)-(0,0): Warning ENC1006: {string.Format(FeaturesResources.UnableToReadSourceFileOrPdb, sourceFile.Path)}"], InspectDiagnostics(emitDiagnostics)); 622AddDocument("a.cs", SourceText.From(source1, Encoding.UTF8, SourceHashAlgorithm.Sha1), filePath: sourceFile.Path); 627var moduleId = EmitAndLoadLibraryToDebuggee(source1, sourceFilePath: sourceFile.Path, checksumAlgorithm: SourceHashAlgorithms.Default); 636using var fileLock = File.Open(sourceFile.Path, FileMode.Open, FileAccess.Read, FileShare.None); 646AssertEx.Equal([$"test.csproj: (0,0)-(0,0): Warning ENC1006: {string.Format(FeaturesResources.UnableToReadSourceFileOrPdb, sourceFile.Path)}"], InspectDiagnostics(emitDiagnostics)); 680AddDocument("test.cs", CreateText(sourceA), filePath: sourceFileA.Path); 685EmitAndLoadLibraryToDebuggee(sourceA, sourceFilePath: sourceFileA.Path); 697var documentB = project.AddTestDocument(sourceB, path: sourceFileB.Path); 769var moduleId = EmitLibrary(source1, sourceFilePath: sourceFile.Path); 776var document0 = project.AddTestDocument(source0, path: sourceFile.Path); 922AddDocument(documentId, "test.cs", SourceText.From(source1, encoding, SourceHashAlgorithm.Sha1), filePath: sourceFile.Path); 925var moduleId = EmitAndLoadLibraryToDebuggee(source1, sourceFilePath: sourceFile.Path, encoding: encoding, checksumAlgorithm: SourceHashAlgorithm.Sha256); 1144var moduleId = EmitAndLoadLibraryToDebuggee(source0, sourceFilePath: sourceFile.Path); 1150var document1 = project.AddTestDocument(source1, path: sourceFile.Path); 1172AssertEx.Equal([$"proj.csproj: (0,0)-(0,0): Warning ENC1005: {string.Format(FeaturesResources.DocumentIsOutOfSyncWithDebuggee, sourceFile.Path)}"], InspectDiagnostics(emitDiagnostics)); 1244AddDocument("test.cs", CreateText(source1), filePath: sourceFile.Path); 1249var moduleId = EmitAndLoadLibraryToDebuggee(source1, sourceFilePath: sourceFile.Path); 1287AddDocument("test.cs", CreateText(source1), filePath: sourceFile.Path); 1292var moduleId = EmitLibrary(source1, sourceFilePath: sourceFile.Path); 1348var moduleId = EmitAndLoadLibraryToDebuggee(source1, sourceFilePath: sourceFile.Path); 1396moduleId = EmitAndLoadLibraryToDebuggee(source3, sourceFilePath: sourceFile.Path);
EditAndContinue\UnitTestingHotReloadServiceTests.cs (3)
33var moduleId = EmitLibrary(source1, sourceFileA.Path, assemblyName: "Proj"); 47loader: new WorkspaceFileTextLoader(solution.Services, sourceFileA.Path, Encoding.UTF8), 48filePath: sourceFileA.Path));
Microsoft.CodeAnalysis.Scripting.Desktop.UnitTests (23)
MetadataShadowCopyProviderTests.cs (23)
88var sc1 = _provider.GetMetadataShadowCopy(dll.Path, MetadataImageKind.Assembly); 89var sc2 = _provider.GetMetadataShadowCopy(dll.Path, MetadataImageKind.Assembly); 91Assert.Equal(dll.Path, sc1.PrimaryModule.OriginalPath); 92Assert.NotEqual(dll.Path, sc1.PrimaryModule.FullPath); 96Assert.Equal(File.ReadAllBytes(dll.Path), File.ReadAllBytes(sc1.PrimaryModule.FullPath)); 97Assert.Equal(File.ReadAllBytes(doc.Path), File.ReadAllBytes(sc1.DocumentationFile.FullPath)); 105_provider.SuppressShadowCopy(dll.Path); 107var sc1 = _provider.GetMetadataShadowCopy(dll.Path, MetadataImageKind.Assembly); 127var sc1 = _provider.GetMetadataShadowCopy(dll.Path, MetadataImageKind.Assembly); 128Assert.NotEqual(dll.Path, sc1.PrimaryModule.FullPath); 140string path0 = dir.CreateFile("MultiModule.dll").WriteAllBytes(TestResources.SymbolsTests.MultiModule.MultiModuleDll).Path; 141string path1 = dir.CreateFile("mod2.netmodule").WriteAllBytes(TestResources.SymbolsTests.MultiModule.mod2).Path; 142string path2 = dir.CreateFile("mod3.netmodule").WriteAllBytes(TestResources.SymbolsTests.MultiModule.mod3).Path; 186var f0 = Temp.CreateFile().WriteAllText("bogus").Path; 189string f1 = Temp.CreateFile().WriteAllBytes(TestResources.SymbolsTests.MultiModule.MultiModuleDll).Path; 200var sc1 = _provider.GetMetadataShadowCopy(dll.Path, MetadataImageKind.Assembly); 201var sc2 = _provider.GetMetadataShadowCopy(dll.Path, MetadataImageKind.Assembly); 203var md1 = _provider.GetMetadata(dll.Path, MetadataImageKind.Assembly); 213var sc3a = _provider.GetMetadataShadowCopy(dll2.Path, MetadataImageKind.Module); 230var sc = provider.GetMetadataShadowCopy(dll.Path, MetadataImageKind.Assembly); 236sc = provider.GetMetadataShadowCopy(dll.Path, MetadataImageKind.Assembly); 242sc = provider.GetMetadataShadowCopy(dll.Path, MetadataImageKind.Assembly); 248sc = provider.GetMetadataShadowCopy(dll.Path, MetadataImageKind.Assembly);
Microsoft.CodeAnalysis.Scripting.UnitTests (6)
RuntimeMetadataReferenceResolverTests.cs (6)
32packageResolver: new PackageResolver(ImmutableDictionary<string, ImmutableArray<string>>.Empty.Add("nuget:N/1.0", ImmutableArray.Create(assembly1.Path, assembly2.Path))), 38AssertEx.SetEqual(actualReferences.SelectAsArray(r => r.FilePath), assembly1.Path, assembly2.Path); 44AssertEx.SetEqual(actualReferences.SelectAsArray(r => r.FilePath), assembly2.Path); 59AssertEx.SetEqual(actualReferences.SelectAsArray(r => r.FilePath), assembly2.Path);
Microsoft.CodeAnalysis.Test.Utilities (15)
AssemblyLoadTestFixture.cs (3)
403", MetadataReference.CreateFromFile(delta1InAnalyzerReferencesDelta1.Path), compilerReference); 547var fileInfo = new FileInfo(tempFile.Path); 550return tempFile.Path;
Metadata\IlasmUtilities.cs (3)
80string sourceFileName = Path.GetFileNameWithoutExtension(sourceFile.Path); 84Path.ChangeExtension(Path.GetFileName(sourceFile.Path), "dll")); 111var arguments = $"\"{sourceFile.Path}\" -DLL {(autoInherit ? "" : "-noautoinherit")} -out=\"{assemblyPath}\"";
Platform\Desktop\DesktopRuntimeUtil.cs (3)
64var name = Path.GetFileName(file.Path); 66var assembly = appDomain.DefineDynamicAssembly(new AssemblyName(name), AssemblyBuilderAccess.Save, Path.GetDirectoryName(file.Path)); 71var image = CommonTestBase.ReadFromFile(file.Path);
Platform\Desktop\TestHelpers.cs (2)
88MetadataReference.CreateFromFile(immutable.Path), 89MetadataReference.CreateFromFile(analyzer.Path)
TempFiles\DisposableFile.cs (4)
29if (Path != null) 33File.Delete(Path); 40DeleteFileOnClose(Path); 48{1}: {2}", Path, ex.GetType().Name, ex.Message), ex);
Microsoft.CodeAnalysis.UnitTests (110)
AnalyzerAssemblyLoaderTests.cs (27)
343var delta1Copy = tempDir.CreateDirectory("a").CreateFile("Delta.dll").CopyContentFrom(testFixture.Delta1).Path; 566var deltaFile = tempDir.CreateDirectory("a").CreateFile("Delta.dll").CopyContentFrom(testFixture.Delta1).Path; 567var gammaFile = tempDir.CreateDirectory("b").CreateFile("Gamma.dll").CopyContentFrom(testFixture.Gamma).Path; 603var alternatePath = tempDir.CreateDirectory("a").CreateFile("Microsoft.CodeAnalysis.ExternalAccess.RazorCompiler.dll").CopyContentFrom(externalAccessRazorPath).Path; 638var alternatePath = dir.CreateFile("Microsoft.CodeAnalysis.ExternalAccess.RazorCompiler.dll").CopyContentFrom(externalAccessRazorPath).Path; 639var deltaFile = dir.CreateFile("Delta.dll").CopyContentFrom(testFixture.Delta1).Path; 678var deltaFile1 = tempDir.CreateDirectory("a").CreateFile("Delta.dll").CopyContentFrom(testFixture.Delta1).Path; 680var gammaFile = tempSubDir.CreateFile("Gamma.dll").CopyContentFrom(testFixture.Gamma).Path; 681var deltaFile2 = tempSubDir.CreateFile("Delta.dll").CopyContentFrom(testFixture.Delta1).Path; 731var deltaFile = tempDir.CreateDirectory("a").CreateFile("Delta.dll").CopyContentFrom(testFixture.Delta1).Path; 732var gammaFile = tempDir.CreateDirectory("b").CreateFile("Gamma.dll").CopyContentFrom(testFixture.Gamma).Path; 1051var epsilonFile = tempDir1.CreateFile("Epsilon.dll").CopyContentFrom(testFixture.Epsilon).Path; 1052var delta1File = tempDir1.CreateFile("Delta.dll").CopyContentFrom(testFixture.Delta1).Path; 1053var delta2File = tempDir2.CreateFile("Delta.dll").CopyContentFrom(testFixture.Delta2).Path; 1311var deltaNewFilePath = dir.CopyFile(deltaFilePath).Path; 1325var assemblyFilePath = dir.CreateFile(assemblyName + ".dll").WriteAllBytes(array).Path; 1456var destFile = tempRoot.CreateDirectory().CreateOrOpenFile($"{assembly.GetName().Name}.dll").Path; 1491var deltaCopy = tempDir.CreateFile("Delta.dll").CopyContentFrom(testFixture.Delta1).Path; 1516var deltaCopy = tempDir.CreateFile("Delta.dll").CopyContentFrom(testFixture.Delta1).Path; 1551var delta1File = tempDir1.CreateFile("Delta.dll").CopyContentFrom(testFixture.Delta1).Path; 1552var delta2File = tempDir2.CreateFile("Delta.dll").CopyContentFrom(testFixture.Delta2).Path; 1553var gammaFile = tempDir3.CreateFile("Gamma.dll").CopyContentFrom(testFixture.Gamma).Path; 1607var path = tempFile.Path; 1641var analyzerPath = tempDir.CreateFile("AnalyzerWithLoc.dll").CopyContentFrom(testFixture.AnalyzerWithLoc).Path; 1642var analyzerResourcesPath = tempDir.CreateDirectory("en-GB").CreateFile("AnalyzerWithLoc.resources.dll").CopyContentFrom(testFixture.AnalyzerWithLocResourceEnGB).Path; 1664var analyzerPath = tempDir.CreateFile("AnalyzerWithLoc.dll").CopyContentFrom(testFixture.AnalyzerWithLoc).Path; 1665var analyzerResourcesPath = tempDir.CreateDirectory("es").CreateFile("AnalyzerWithLoc.resources.dll").CopyContentFrom(testFixture.AnalyzerWithLocResourceEnGB).Path;
Analyzers\AnalyzerFileReferenceAppDomainTests.cs (4)
54var exception = remoteTest.LoadAnalyzer(dir.CreateDirectory("shadow").Path, analyzerFile.Path); 100MetadataReference.CreateFromFile(immutable.Path), 101MetadataReference.CreateFromFile(analyzer.Path) 112var exception = remoteTest.LoadAnalyzer(dir.CreateDirectory("shadow").Path, analyzerFile.Path);
Analyzers\AnalyzerFileReferenceTests.cs (4)
199var textFile = directory.CreateFile("Goo.txt").WriteAllText("I am the very model of a modern major general.").Path; 231var textFile = directory.CreateFile("Goo.txt").WriteAllText("I am the very model of a modern major general.").Path; 319args: new[] { "/nologo", $@"/analyzer:""{_testFixture.AnalyzerWithLaterFakeCompilerDependency}""", "/nostdlib", $@"/r:""{corlib}""", "/out:something.dll", source.Path }, 348args: new[] { "/nologo", $@"/analyzer:""{_testFixture.AnalyzerWithFakeCompilerDependency}""", $@"/analyzer:""{_testFixture.AnalyzerWithFakeCompilerDependency}""", "/nostdlib", $@"/r:""{corlib}""", "/out:something.dll", source.Path },
AssemblyUtilitiesTests.cs (12)
46var assemblyFile = directory.CreateFile("FakeAssembly.dll").Path; 58var assemblyFile = directory.CreateFile("FakeAssembly.dll").Path; 59var satelliteFile = directory.CreateFile("FakeAssembly.resources.dll").Path; 71var assemblyFile = directory.CreateFile("FakeAssembly.dll").Path; 72var satelliteFile = directory.CreateDirectory("de").CreateFile("FakeAssembly.resources.dll").Path; 84var assemblyFile = directory.CreateFile("FakeAssembly.dll").Path; 85var satelliteFile = directory.CreateDirectory("de").CreateDirectory("FakeAssembly.resources").CreateFile("FakeAssembly.resources.dll").Path; 97var assemblyFile = directory.CreateFile("FakeAssembly.dll").Path; 98var satelliteFileDE = directory.CreateDirectory("de").CreateFile("FakeAssembly.resources.dll").Path; 99var satelliteFileFR = directory.CreateDirectory("fr").CreateFile("FakeAssembly.resources.dll").Path; 111var assemblyFile = directory.CreateFile("FakeAssembly.dll").Path; 112var satelliteFile = directory.CreateDirectory("de").CreateDirectory("OtherAssembly.resources").CreateFile("FakeAssembly.resources.dll").Path;
CommonCommandLineParserTests.cs (14)
45return RuleSet.LoadEffectiveRuleSetFromFile(file.Path); 48return RuleSetProcessor.LoadFromFile(file.Path); 474var ruleSet = RuleSet.LoadEffectiveRuleSetFromFile(file.Path); 989RuleSet.LoadEffectiveRuleSetFromFile(file.Path); 994Assert.Contains(string.Format(CodeAnalysisResources.InvalidRuleSetInclude, newFile.Path, string.Format(CodeAnalysisResources.RuleSetBadAttributeValue, "Action", "Default")), e.Message, StringComparison.Ordinal); 1014var includePaths = RuleSet.GetEffectiveIncludesFromFile(file.Path); 1017Assert.Equal(expected: file.Path, actual: includePaths[0]); 1051var includePaths = RuleSet.GetEffectiveIncludesFromFile(file.Path); 1054Assert.Equal(expected: file.Path, actual: includePaths[0]); 1055Assert.Equal(expected: include.Path, actual: includePaths[1]); 1103var includePaths = RuleSet.GetEffectiveIncludesFromFile(file.Path); 1106Assert.Equal(expected: file.Path, actual: includePaths[0]); 1107Assert.Equal(expected: include1.Path, actual: includePaths[1]); 1108Assert.Equal(expected: include2.Path, actual: includePaths[2]);
FileSystem\RelativePathResolverTests.cs (2)
167var f1 = dir1.CreateFile("f.dll").Path; 168var f2 = dir2.CreateFile("f.dll").Path;
MetadataReferences\AssemblyIdentityComparerTests.cs (1)
632policyPath: appConfig.Path);
MetadataReferences\AssemblyMetadataTests.cs (2)
59var mm = dir.CreateFile("MultiModule.dll").WriteAllBytes(TestResources.SymbolsTests.MultiModule.MultiModuleDll).Path; 142var metadata = AssemblyMetadata.CreateFromFile(invalidModuleName.Path);
MetadataReferences\AssemblyPortabilityPolicyTests.cs (28)
75var stream = new FileStream(appConfig.Path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite); 80Assert.Throws<COMException>(() => FusionAssemblyPortabilityPolicy.LoadFromFile(appConfig.Path)); 89Assert.Throws<COMException>(() => FusionAssemblyPortabilityPolicy.LoadFromFile(appConfig.Path)); 105Assert.Throws<COMException>(() => FusionAssemblyPortabilityPolicy.LoadFromFile(appConfig.Path)); 125var stream = new FileStream(appConfig.Path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite); 127AssertIsEnabled(appConfig.Path, platform: false, nonPlatform: true, fusionOnly: true); 142<linkedConfiguration href=""file://" + appConfig2.Path + @"""/> 161AssertIsEnabled(appConfig1.Path, platform: false, nonPlatform: true); 175AssertIsEnabled(appConfig.Path, platform: true, nonPlatform: true); 183AssertIsEnabled(appConfig.Path, platform: true, nonPlatform: true); 193AssertIsEnabled(appConfig.Path, platform: true, nonPlatform: true); 209AssertIsEnabled(appConfig.Path, platform: true, nonPlatform: true); 227AssertIsEnabled(appConfig.Path, platform: true, nonPlatform: true); 245AssertIsEnabled(appConfig.Path, platform: false, nonPlatform: true); 263AssertIsEnabled(appConfig.Path, platform: true, nonPlatform: false); 281AssertIsEnabled(appConfig.Path, platform: true, nonPlatform: false); 300AssertIsEnabled(appConfig.Path, platform: false, nonPlatform: false); 320AssertIsEnabled(appConfig.Path, platform: true, nonPlatform: false); 344AssertIsEnabled(appConfig.Path, platform: true, nonPlatform: true); 364AssertIsEnabled(appConfig.Path, platform: true, nonPlatform: true); 381AssertIsEnabled(appConfig.Path, platform: true, nonPlatform: true); 389var policy = FusionAssemblyPortabilityPolicy.LoadFromFile(appConfig.Path); 402var policy1 = FusionAssemblyPortabilityPolicy.LoadFromFile(appConfig.Path); 403var policy2 = FusionAssemblyPortabilityPolicy.LoadFromFile(appConfig.Path); 408policy2 = FusionAssemblyPortabilityPolicy.LoadFromFile(appConfig.Path); 413policy2 = FusionAssemblyPortabilityPolicy.LoadFromFile(appConfig.Path); 427policy2 = FusionAssemblyPortabilityPolicy.LoadFromFile(appConfig.Path); 432policy2 = FusionAssemblyPortabilityPolicy.LoadFromFile(appConfig2.Path);
MetadataReferences\MetadataReferenceTests.cs (12)
96var stream = File.OpenRead(file.Path); 110File.Delete(file.Path); 163var r = MetadataReference.CreateFromFile(file.Path, 166Assert.Equal(file.Path, r.FilePath); 167Assert.Equal(file.Path, r.Display); 173Assert.Equal(props, MetadataReference.CreateFromFile(file.Path, props).Properties); 176File.Delete(file.Path); 187var r = MetadataReference.CreateFromFile(file.Path, MetadataReferenceProperties.Module); 189Assert.Equal(file.Path, r.FilePath); 190Assert.Equal(file.Path, r.Display); 196Assert.Equal(props, MetadataReference.CreateFromFile(file.Path, props).Properties); 199File.Delete(file.Path);
Text\StringTextDecodingTests.cs (4)
218string path = Temp.CreateFile().WriteAllBytes(encoding.GetBytes(expectedText)).Path; 306File.WriteAllText(tmpFile.Path, expectedText, encoding); 308using (FileStream fs = new FileStream(tmpFile.Path, FileMode.Open, FileAccess.Read)) 322using (FileStream fs = new FileStream(tmpFile.Path, FileMode.Open, FileAccess.Read))
Microsoft.CodeAnalysis.VisualBasic.CommandLine.UnitTests (235)
CommandLineBreakingChanges.vb (15)
25").Path 28Dim output = ProcessUtilities.RunAndGetOutput("cmd", "/C """ & s_basicCompilerExecutable & """ /nologo /preferreduilang:en /warnaserror+ /warnaserror- /out:" & tempBinary.Path & " " & src & " > " & tempLog.Path, expectedRetCode:=0) 42CleanupAllGeneratedFiles(tempBinary.Path) 43CleanupAllGeneratedFiles(tempLog.Path) 57</text>.Value).Path 59Dim output = ProcessUtilities.RunAndGetOutput("cmd", "/C """ & s_basicCompilerExecutable & """ /nologo /preferreduilang:en /optionstrict:custom /nowarn:41008 /warnaserror+ " & src & " > " & tempOut.Path, expectedRetCode:=1) 89</text>.Value).Path 91Dim output = ProcessUtilities.RunAndGetOutput("cmd", "/C """ & s_basicCompilerExecutable & """ /nologo /preferreduilang:en /optionstrict:custom /nowarn:41008 /warnaserror+ " & src & " > " & tempOut.Path, expectedRetCode:=1) 121</text>.Value).Path 123Dim output = ProcessUtilities.RunAndGetOutput("cmd", "/C """ & s_basicCompilerExecutable & """ /nologo /preferreduilang:en /optionstrict:custom /warnaserror-:42025 /warnaserror+ " & src & " > " & tempOut.Path, expectedRetCode:=1) 142CleanupAllGeneratedFiles(tempOut.Path) 156</text>.Value).Path 158Dim output = ProcessUtilities.RunAndGetOutput("cmd", "/C """ & s_basicCompilerExecutable & """ /nologo /preferreduilang:en /optionstrict:custom /warnaserror-:42025 /warnaserror+ " & src & " > " & tempOut.Path, expectedRetCode:=1) 177CleanupAllGeneratedFiles(tempOut.Path)
CommandLineIVTTests.vb (17)
40source2.Path 48{source2.Path}(3) : error BC30389: 'N1.A' is not accessible in this context because it is 'Friend'. 51{source2.Path}(3) : error BC37327: 'A' is defined in assembly 'N1, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. 141source2.Path 149{source2.Path}(5) : error BC30390: 'A.Friend Sub M()' is not accessible in this context because it is 'Friend'. 152{source2.Path}(5) : error BC37327: 'Friend Sub M()' is defined in assembly 'N1, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. 242source2.Path 250{source2.Path}(5) : error BC31417: 'Friend Overrides Sub M()' cannot override 'Friend Overridable Sub M()' because it is not accessible in this context. 253{source2.Path}(5) : error BC37327: 'Friend Overridable Sub M()' is defined in assembly 'N1, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. 353source2.Path 361{source2.Path}(4) : error BC31109: Implementing class 'Class1.FooImpl' for interface 'Class1.IFoo' is not accessible in this context because it is 'Friend'. 364{source2.Path}(5) : error BC31109: Implementing class 'Class1.FooImpl' for interface 'Class1.IFoo' is not accessible in this context because it is 'Friend'. 367{source2.Path}(4) : error BC37327: 'Class1.FooImpl' is defined in assembly 'N1, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. 370{source2.Path}(5) : error BC37327: 'Class1.FooImpl' is defined in assembly 'N1, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. 471source3.Path 479{source3.Path}(5) : error BC36666: 'Friend Function N2.B.M() As N1.A' is not accessible in this context because the return type is not accessible. 482{source3.Path}(5) : error BC37327: 'Friend Function M() As A' is defined in assembly 'N2, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.
CommandLineTests.vb (192)
81"/analyzerconfig:" + analyzerConfig.Path, 82src.Path}) 84Assert.Equal(analyzerConfig.Path, Assert.Single(cmd.Arguments.AnalyzerConfigPaths)) 118"/analyzerconfig:" + analyzerConfig.Path, 121"/additionalfile:" + additionalFile.Path, 122src.Path}) 124Assert.Equal(analyzerConfig.Path, Assert.Single(cmd.Arguments.AnalyzerConfigPaths)) 176"/analyzerconfig:" + analyzerConfig.Path, 177src.Path}) 179Assert.Equal(analyzerConfig.Path, Assert.Single(cmd.Arguments.AnalyzerConfigPaths)) 185$"vbc : warning InvalidSeverityInAnalyzerConfig: The diagnostic 'bc42024' was given an invalid severity 'garbage' in the analyzer config file at '{analyzerConfig.Path}'. 186{src.Path}(4) : warning BC42024: Unused local variable: 'x'. 213"/analyzerconfig:" + analyzerConfig1.Path, 214"/analyzerconfig:" + analyzerConfig2.Path, 215src.Path 239Dim cmd = New MockVisualBasicCompiler(Nothing, dir.Path, {"/nologo", "/errorlog:errorlog", $"/doc:{docName}", "/warnaserror", src.Path}) 258Dim cmd = New MockVisualBasicCompiler(Nothing, dir.Path, {"/nologo", "/t:library", "/preferreduilang:en", $"/doc:{docName}", src.Path}) 286</text>.Value).Path 332</text>.Value).Path 358").Path 470</text>.Value).Path 511</text>.Value).Path 529</text>.Value).Path 547</text>.Value).Path 588</text>.Value).Path 609Dim src As String = Temp.CreateFile().WriteAllText("♚", New System.Text.UTF8Encoding(False)).Path 613Dim output = ProcessUtilities.RunAndGetOutput("cmd", "/C """ & s_basicCompilerExecutable & """ /nologo /preferreduilang:en /t:library " & src & " > " & tempOut.Path, expectedRetCode:=1) 628Dim src As String = Temp.CreateFile().WriteAllText("♚", New System.Text.UTF8Encoding(False)).Path 632Dim output = ProcessUtilities.RunAndGetOutput("cmd", "/C """ & s_basicCompilerExecutable & """ /utf8output /nologo /preferreduilang:en /t:library " & src & " > " & tempOut.Path, expectedRetCode:=1) 758</text>.Value).Path 780</text>.Value).Path 929/imports:System.Text</text>.Value).Path 991Dim tmpFileName As String = Temp.CreateFile().WriteAllBytes(New Byte() {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}).Path 1010End Module").Path 1011Dim badres = Temp.CreateFile().WriteAllBytes(New Byte() {0, 0}).Path 2394CleanupAllGeneratedFiles(file1.Path) 2395CleanupAllGeneratedFiles(file2.Path) 2396CleanupAllGeneratedFiles(file3.Path) 2397CleanupAllGeneratedFiles(file4.Path) 2398CleanupAllGeneratedFiles(file5.Path) 2458CleanupAllGeneratedFiles(file1.Path) 2459CleanupAllGeneratedFiles(file2.Path) 2460CleanupAllGeneratedFiles(file3.Path) 2461CleanupAllGeneratedFiles(file4.Path) 2462CleanupAllGeneratedFiles(file5.Path) 2463CleanupAllGeneratedFiles(file6.Path) 2609CleanupAllGeneratedFiles(file.Path) 2626CleanupAllGeneratedFiles(file.Path) 2648CleanupAllGeneratedFiles(file.Path) 2672Dim vbc = New MockVisualBasicCompiler(Nothing, dir.Path, {"/nologo", "/t:library", "/a:" + Assembly.GetExecutingAssembly().Location, "a.vb", "/ruleset:" + ruleSetFile.Path}) 2682CleanupAllGeneratedFiles(file.Path) 2706"/ruleset:" & ruleSetFile.Path, "/warnaserror", "/nowarn:42376" 2720"/warnaserror+", "/ruleset:" & ruleSetFile.Path, "/nowarn:42376" 2729CleanupAllGeneratedFiles(file.Path) 2756"/ruleset:" & ruleSetFile.Path, "/nowarn" 2771"/nowarn", "/ruleset:" & ruleSetFile.Path 2781CleanupAllGeneratedFiles(file.Path) 2806Dim vbc = New MockVisualBasicCompiler(Nothing, dir.Path, {"/nologo", "/t:library", "/a:" + Assembly.GetExecutingAssembly().Location, "a.vb", "/ruleset:" + ruleSetFile.Path}) 2815CleanupAllGeneratedFiles(file.Path) 2839Dim parsedArgs = DefaultParse(New String() {"/ruleset:" + file.Path, "a.cs"}, _baseDirectory) 2841Assert.Equal(expected:=file.Path, actual:=parsedArgs.RuleSetPath) 2864Dim parsedArgs = DefaultParse(New String() {"/ruleset:" + """" + file.Path + """", "a.cs"}, _baseDirectory) 2866Assert.Equal(expected:=file.Path, actual:=parsedArgs.RuleSetPath) 2892parsedArgs = DefaultParse(New String() {"/ruleset:" + file.Path, "a.cs"}, _baseDirectory) 2895Assert.Equal(expected:=file.Path, actual:=parsedArgs.RuleSetPath) 2900Assert.Equal(file.Path, DirectCast(err.Arguments(0), String)) 3204AssertEx.Equal(File.ReadAllBytes(sl.Path), blob) 3208CleanupAllGeneratedFiles(src.Path) 3233AssertEx.Equal(File.ReadAllBytes(sl.Path), blob) 3236CleanupAllGeneratedFiles(src.Path) 3369expectedEmbeddedMap.Add(src.Path, embed_vb) 3373expectedEmbeddedMap.Add(src2.Path, embed2_vb) 3377expectedEmbeddedMap.Add(txt.Path, embed_xyz) 3396CleanupAllGeneratedFiles(src.Path) 3628CleanupAllGeneratedFiles(file.Path) 4119CleanupAllGeneratedFiles(src.Path) 4169CleanupAllGeneratedFiles(src.Path) 4170CleanupAllGeneratedFiles(xml.Path) 4250CleanupAllGeneratedFiles(src.Path) 4251CleanupAllGeneratedFiles(xml.Path) 4270CleanupAllGeneratedFiles(src.Path) 4289CleanupAllGeneratedFiles(src.Path) 4308CleanupAllGeneratedFiles(src.Path) 4327CleanupAllGeneratedFiles(src.Path) 4346CleanupAllGeneratedFiles(src.Path) 4365CleanupAllGeneratedFiles(src.Path) 4948Dim binaryPath = Temp.CreateFile().WriteAllBytes(Net461.Resources.mscorlib).Path 5025CleanupAllGeneratedFiles(src.Path) 5042CleanupAllGeneratedFiles(src.Path) 5049Dim filePath = tempFolder.CreateFile("temp.dll").Path 5070CleanupAllGeneratedFiles(src.Path) 5164CleanupAllGeneratedFiles(src.Path) 5196CleanupAllGeneratedFiles(src.Path) 5270File.Delete(sysRuntime.Path) 5276File.Delete(msCorLib.Path) 5278CleanupAllGeneratedFiles(src.Path) 5323File.Delete(msCorLib.Path) 5324CleanupAllGeneratedFiles(src.Path) 5357CleanupAllGeneratedFiles(src.Path) 5380CleanupAllGeneratedFiles(file.Path) 5783CleanupAllGeneratedFiles(file1.Path) 5784CleanupAllGeneratedFiles(file2.Path) 5968CleanupAllGeneratedFiles(file.Path) 6019CleanupAllGeneratedFiles(file.Path) 6058CleanupAllGeneratedFiles(file.Path) 6106CleanupAllGeneratedFiles(file.Path) 6150CleanupAllGeneratedFiles(file.Path) 6198CleanupAllGeneratedFiles(file.Path) 6244CleanupAllGeneratedFiles(file.Path) 6286CleanupAllGeneratedFiles(file.Path) 6290Return result.Value.Replace("PATH", file.Path).Replace("VERSION (HASH)", s_compilerVersion).Replace(vbLf, vbCrLf) 6322CleanupAllGeneratedFiles(file.Path) 6356CleanupAllGeneratedFiles(file.Path) 6390CleanupAllGeneratedFiles(file.Path) 6422CleanupAllGeneratedFiles(file.Path) 6454CleanupAllGeneratedFiles(file.Path) 6502CleanupAllGeneratedFiles(file.Path) 6839Path.GetFileName(sourceFile.Path) 6847String.Format("/win32manifest:{0}", Path.GetFileName(manifestFile.Path)), 6848Path.GetFileName(sourceFile.Path) 6872CleanupAllGeneratedFiles(sourceFile.Path) 6887Dim source As String = folder.CreateFile("src.vb").WriteAllText("").Path 6888Dim ref As String = folder.CreateFile("ref.dll").WriteAllText("").Path 6920</text>.Value).Path 6924</text>.Value).Path 6968</text>.Value).Path 6972</text>.Value).Path 7002</text>.Value).Path 7006</text>.Value).Path 7036</text>.Value).Path 7040</text>.Value).Path 7065</text>.Value).Path 7070</text>.Value).Path 7089</text>.Value).Path 7257</text>.Value).Path 7278</text>.Value).Path 7315</text>.Value).Path 7470</text>.Value).Path 7568CleanupAllGeneratedFiles(src.Path) 7624file.Path & "(4) : error BC30451: 'Goo' is not declared. It may be inaccessible due to its protection level. 7657" & file.Path & "(35) : error BC30451: 'Goo' is not declared. It may be inaccessible due to its protection level. 7665CleanupAllGeneratedFiles(file.Path) 7729CleanupAllGeneratedFiles(file.Path) 7748CleanupAllGeneratedFiles(file.Path) 7937sourceFile.Path 8012CleanupAllGeneratedFiles(file.Path) 8138CleanupAllGeneratedFiles(file.Path) 8293CleanupAllGeneratedFiles(file.Path) 8516CleanupAllGeneratedFiles(file.Path) 8593CleanupAllGeneratedFiles(file.Path) 8655CleanupAllGeneratedFiles(file.Path) 8704CleanupAllGeneratedFiles(src.Path) 8954</text>.Value).Path 9011</text>.Value).Path 9034</text>.Value).Path 9058</text>.Value).Path 9079</text>.Value).Path 9101</text>.Value).Path 9106</text>.Value).Path 9110</text>.Value).Path 9162CleanupAllGeneratedFiles(file.Path) 9576CleanupAllGeneratedFiles(sourceFile.Path) 9682Dim vbcPath = dir.CopyFile(s_basicCompilerExecutable).Path 9742End Class").Path 9748Dim filePath = Temp.CreateFile().WriteAllText("").Path 9805CleanupAllGeneratedFiles(file.Path) 9857CleanupAllGeneratedFiles(file.Path) 9883CleanupAllGeneratedFiles(file.Path) 9949CleanupAllGeneratedFiles(file.Path) 9977CleanupAllGeneratedFiles(file.Path) 10055additionalFlags = additionalFlags.Append("/analyzerconfig:" + analyzerConfig.Path).ToArray() 10112additionalFlags = additionalFlags.Append("/ruleset:" + ruleSetFile.Path).ToArray() 10185Dim args = {"/nologo", "/t:library", "/preferreduilang:en", src.Path} 10225Dim args = {"/warnaserror+", $"/warnaserror-:{diagnosticId}", "/nologo", "/t:library", "/preferreduilang:en", src.Path} 10304additionalFlags = additionalFlags.Append($"/analyzerconfig:{analyzerConfig.Path}").ToArray() 10347Dim globalOption = "/analyzerconfig:" + globalConfig.Path 10348Dim specificOption = "/analyzerconfig:" + analyzerConfig.Path 10378additionalFlags = additionalFlags.Append("/analyzerconfig:" & globalConfig.Path).ToArray() 10410VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference:=False, additionalFlags:={"/warnaserror+", "/analyzerconfig:" + globalConfig.Path}) 10432additionalFlags:={"/additionalfile:" & additionalFile.Path}, 10507additionalArgs = additionalArgs.Append($"/analyzerconfig:{analyzerConfig.Path}").ToArray() 10579CleanupAllGeneratedFiles(src.Path) 10601CleanupAllGeneratedFiles(src.Path) 10628CleanupAllGeneratedFiles(src.Path) 10644CleanupAllGeneratedFiles(src.Path) 10719CleanupAllGeneratedFiles(src.Path) 10759"/analyzerconfig:" + analyzerConfig.Path, 10760src.Path}) 10802"/analyzerconfig:" + analyzerConfig.Path, 10803src.Path}) 10847"/analyzerconfig:" + analyzerConfig.Path, 10848src.Path})
SarifErrorLoggerTests.vb (4)
47Dim hello = Temp.CreateFile().WriteAllText(helloWorldVB).Path 82Dim sourceFilePath = Temp.CreateFile().WriteAllText(source).Path 123Dim sourceFilePath = Temp.CreateFile().WriteAllText(source).Path 161Dim sourceFilePath = Temp.CreateFile().WriteAllText(source).Path
TouchedFileLoggingTests.vb (7)
34Dim hello = Temp.CreateFile().WriteAllText(_helloWorldCS).Path 64Dim hello = Temp.CreateFile().WriteAllText(_helloWorldCS).Path 65Dim snkPath = Temp.CreateFile("TestKeyPair_", ".snk").WriteAllBytes(TestResources.General.snKey).Path 106]]></text>.Value).Path 114"/doc:" + xml.Path, 124expectedWrites.Add(xml.Path) 156CleanupAllGeneratedFiles(xml.Path)
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (13)
Attributes\InternalsVisibleToAndStrongNameTests.vb (13)
450<assembly: System.Reflection.AssemblyKeyFile("]]><%= snk.Path %><![CDATA[")> 457c = CreateCompilationWithMscorlib40(source1, options:=TestOptions.ReleaseModule.WithCryptoKeyFile(snk.Path).WithPublicSign(True), parseOptions:=parseOptions) 505options:=TestOptions.ReleaseDll.WithCryptoKeyFile(tmp.Path).WithStrongNameProvider(New DesktopStrongNameProvider()), 509Diagnostic(ERRID.ERR_PublicKeyFileFailure).WithArguments(tmp.Path, CodeAnalysisResources.InvalidPublicKey)) 1454Using peStream = New FileStream(file.Path, FileMode.Open) 2042Dim options = TestOptions.ReleaseDll.WithCryptoKeyFile(snk.Path).WithPublicSign(True) 2050Dim options = TestOptions.ReleaseDll.WithCryptoKeyFile(snk.Path).WithPublicSign(True) 2058Dim options = TestOptions.SigningReleaseDll.WithCryptoKeyFile(snk.Path).WithPublicSign(True) 2066Dim options = TestOptions.ReleaseDll.WithCryptoKeyFile(snk.Path).WithPublicSign(True) 2104Dim options = TestOptions.ReleaseDll.WithCryptoKeyFile(snk.Path).WithPublicSign(True) 2129Dim options = TestOptions.ReleaseDll.WithCryptoKeyFile(snk.Path).WithPublicSign(True) 2143Dim options = TestOptions.ReleaseDll.WithCryptoKeyFile(snk.Path).WithPublicSign(True).WithDelaySign(True) 2168Dim options = TestOptions.ReleaseDll.WithCryptoKeyFile(snk.Path).WithPublicSign(True).WithDelaySign(False)
Microsoft.CodeAnalysis.VisualBasic.Scripting.UnitTests (2)
CommandLineRunnerTests.vb (2)
61Dim runner = CreateRunner(args:={}, input:="#r """ & file1.Path & """" & vbCrLf & "? New C1().Goo()") 66> #r """ & file1.Path & """
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (1)
Semantics\FieldInitializerBindingTests.vb (1)
1397reference = MetadataReference.CreateFromImage(ReadFromFile(tempAssembly.Path))
Microsoft.CodeAnalysis.VisualBasic.Symbol.UnitTests (46)
SymbolsTests\ExtensionMethods\ExtensionMethodTests.vb (6)
211Dim ILRef = MetadataReference.CreateFromImage(ReadFromFile(reference.Path)) 421Dim ILRef = MetadataReference.CreateFromImage(ReadFromFile(reference.Path)) 616Dim ILRef = MetadataReference.CreateFromImage(ReadFromFile(reference.Path)) 810Dim ILRef = MetadataReference.CreateFromImage(ReadFromFile(reference.Path)) 1006Dim ILRef = ModuleMetadata.CreateFromImage(File.ReadAllBytes(reference.Path)).GetReference() 2234Dim ILRef = ModuleMetadata.CreateFromImage(File.ReadAllBytes(reference.Path)).GetReference()
SymbolsTests\InaccessibleOverriding.vb (8)
351Dim proj2AssemblyName = IO.Path.GetFileNameWithoutExtension(proj2ILFile.Path) 352Dim proj2Ref = MetadataReference.CreateFromImage(ReadFromFile(proj2ILFile.Path)) 402Dim proj1Ref = MetadataReference.CreateFromImage(ReadFromFile(proj1ILFile.Path)) 482Dim proj2AssemblyName = IO.Path.GetFileNameWithoutExtension(proj2ILFile.Path) 483Dim proj2Ref = MetadataReference.CreateFromImage(ReadFromFile(proj2ILFile.Path)) 526Dim proj1Ref = MetadataReference.CreateFromImage(ReadFromFile(proj1ILFile.Path)) 623Dim ilRef = MetadataReference.CreateFromImage(ReadFromFile(reference.Path)) 709Dim ilRef = MetadataReference.CreateFromImage(ReadFromFile(reference.Path))
SymbolsTests\Metadata\PE\TypeForwarders.vb (3)
1105ilBytes = ReadFromFile(reference.Path) 1167ilBytes = ReadFromFile(reference.Path) 1286ilBytes = ReadFromFile(reference.Path)
SymbolsTests\Source\ImplementsTests.vb (8)
3872reference = MetadataReference.CreateFromImage(ReadFromFile(tempAssembly.Path)) 3956reference = MetadataReference.CreateFromImage(ReadFromFile(tempAssembly.Path)) 4051reference = MetadataReference.CreateFromImage(ReadFromFile(tempAssembly.Path)) 4109reference = MetadataReference.CreateFromImage(ReadFromFile(tempAssembly.Path)) 4178reference = MetadataReference.CreateFromImage(ReadFromFile(tempAssembly.Path)) 4247reference = MetadataReference.CreateFromImage(ReadFromFile(tempAssembly.Path)) 4332reference = MetadataReference.CreateFromImage(ReadFromFile(tempAssembly.Path)) 4397reference = MetadataReference.CreateFromImage(ReadFromFile(tempAssembly.Path))
SymbolsTests\Source\OverridesTests.vb (15)
2752reference = MetadataReference.CreateFromImage(ReadFromFile(tempAssembly.Path)) 3080reference = MetadataReference.CreateFromImage(ReadFromFile(tempAssembly.Path)) 3182reference = MetadataReference.CreateFromImage(ReadFromFile(tempAssembly.Path)) 3445reference = MetadataReference.CreateFromImage(ReadFromFile(tempAssembly.Path)) 3559reference = MetadataReference.CreateFromImage(ReadFromFile(tempAssembly.Path)) 3669reference = MetadataReference.CreateFromImage(ReadFromFile(tempAssembly.Path)) 3778reference = MetadataReference.CreateFromImage(ReadFromFile(tempAssembly.Path)) 3890reference = MetadataReference.CreateFromImage(ReadFromFile(tempAssembly.Path)) 4000reference = MetadataReference.CreateFromImage(ReadFromFile(tempAssembly.Path)) 4108reference = MetadataReference.CreateFromImage(ReadFromFile(tempAssembly.Path)) 4779reference = MetadataReference.CreateFromImage(ReadFromFile(tempAssembly.Path)) 5001reference = MetadataReference.CreateFromImage(ReadFromFile(tempAssembly.Path)) 5162reference = MetadataReference.CreateFromImage(ReadFromFile(tempAssembly.Path)) 5430reference = MetadataReference.CreateFromImage(ReadFromFile(tempAssembly.Path)) 5967reference = MetadataReference.CreateFromImage(ReadFromFile(tempAssembly.Path))
SymbolsTests\Source\TypeTests.vb (6)
3156ilBytes = ReadFromFile(reference.Path) 3222ilBytes = ReadFromFile(reference.Path) 3329ilBytes = ReadFromFile(reference.Path) 3336ilBytes = ReadFromFile(reference.Path) 3343ilBytes = ReadFromFile(reference.Path) 3374ilBytes = ReadFromFile(reference.Path)
Microsoft.CodeAnalysis.VisualBasic.Test.Utilities (2)
BasicTestBase.vb (1)
380reference = MetadataReference.CreateFromImage(ReadFromFile(tempAssembly.Path))
CompilationTestUtils.vb (1)
405ilImage = ImmutableArray.Create(File.ReadAllBytes(reference.Path))
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (1)
VisualStudioMSBuildWorkspaceTests.cs (1)
3235var expectedEditorConfigPath = SolutionDirectory.CreateOrOpenFile(".editorconfig").Path;
Microsoft.CodeAnalysis.Workspaces.UnitTests (9)
CommandLineProject\CommandLineProjectWorkspaceTests.cs (1)
40Assert.Equal(tempFile.Path, gooDoc.FilePath);
SolutionTests\SolutionTests.cs (8)
1628solution = solution.AddDocument(DocumentInfo.Create(fileDocumentId, "d.cs", loader: new FileTextLoader(fileD.Path, defaultEncoding: null), filePath: fileD.Path)); 3301.AddDocument(did, "x", new WorkspaceFileTextLoader(workspace.Services.SolutionServices, file.Path, Encoding.UTF8)); 3350.AddDocument(did, "x", new WorkspaceFileTextLoader(workspace.Services.SolutionServices, file.Path, Encoding.UTF8)); 3417.AddDocument(did, "x", new WorkspaceFileTextLoader(workspace.Services.SolutionServices, file.Path, Encoding.UTF8)); 4507var loader = new TestSmallFileTextLoader(file.Path, Encoding.UTF8); 4509var textLength = FileUtilities.GetFileLength(file.Path); 4511var expected = string.Format(WorkspacesResources.File_0_size_of_1_exceeds_maximum_allowed_size_of_2, file.Path, textLength, 1);
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (27)
PersistentStorage\AbstractPersistentStorageTests.cs (3)
980var info = SolutionInfo.Create(SolutionId.CreateNewId(), VersionStamp.Create(), solutionFile.Path); 989filePath: nullPaths ? null : projectFile.Path)); 994filePath: nullPaths ? null : documentFile.Path));
ProjectSystemShim\CPS\AnalyzersTests.cs (5)
39project.SetOptions(ImmutableArray.Create($"/ruleset:{ruleSetFile.Path}")); 63project.SetOptions(ImmutableArray.Create($"/ruleset:{ruleSetFile.Path}")); 66project.SetOptions(ImmutableArray.Create($"/ruleset:{ruleSetFile.Path}")); 80project.SetOptions(ImmutableArray.Create($"/ruleset:{ruleSetFile.Path}")); 84Assert.Equal(ruleSetFile.Path, environment.Workspace.TryGetRuleSetPathForProject(projectId));
ProjectSystemShim\CPS\CSharpCompilerOptionsTests.cs (1)
163var newFilePath = Temp.CreateFile().Path;
ProjectSystemShim\CPS\CSharpReferencesTests.cs (1)
135var analyzerAssemblyFullPath = tempRoot.CreateFile().Path;
ProjectSystemShim\LegacyProject\AnalyzersTests.cs (14)
43((IAnalyzerHost)project).SetRuleSetFile(ruleSetFile.Path); 58((IAnalyzerHost)project).SetRuleSetFile(ruleSetFile.Path); 61Assert.Equal(ruleSetFile.Path, environment.Workspace.TryGetRuleSetPathForProject(projectId)); 77((IAnalyzerHost)project).SetRuleSetFile(ruleSetFile.Path); 108((IAnalyzerHost)project).SetRuleSetFile(ruleSetFile.Path); 131((IAnalyzerHost)project).SetRuleSetFile(ruleSetFile.Path); 146var pathWithExtraBackslashes = ruleSetFile.Path.Replace(@"\", @"\\"); 152Assert.Equal(expected: ruleSetFile.Path, actual: projectRuleSetFile); 174((IAnalyzerHost)project).SetRuleSetFile(ruleSetFile.Path); 209((IAnalyzerHost)project).SetRuleSetFile(ruleSetFile.Path); 236await CSharpHelpers.CreateCSharpCPSProjectAsync(environment, "Test", binOutputPath: @"C:\test.dll", $"/ruleset:\"{ruleSetFile.Path}\""); 242((IAnalyzerHost)project).SetRuleSetFile(ruleSetFile.Path); 251File.WriteAllText(ruleSetFile.Path, ruleSetSource.Replace("Error", "Warning")); 252await environment.RaiseFileChangeAsync(ruleSetFile.Path);
ProjectSystemShim\VisualStudioCompilationOutputFilesTests.cs (3)
40var debugDirPdbPath = exactPdbPath ? pdbFile.Path : "a/y/z/lib.pdb"; 50var outputs = new CompilationOutputFilesWithImplicitPdbPath(dllFile.Path); 95var outputs = new CompilationOutputFilesWithImplicitPdbPath(dllFile.Path);
Microsoft.VisualStudio.LanguageServices.UnitTests (1)
Diagnostics\VisualStudioDiagnosticAnalyzerProviderTests.vb (1)
55Dim hostAnalyzers = New HostDiagnosticAnalyzers(ImmutableArray.Create(Of AnalyzerReference)(New AnalyzerFileReference(analyzerFile.Path, analyzerLoader)))
Roslyn.VisualStudio.Next.UnitTests (9)
Remote\SnapshotSerializationTests.cs (7)
427var reference = new AnalyzerFileReference(location, new MockShadowCopyAnalyzerAssemblyLoader(ImmutableDictionary<string, string>.Empty.Add(location, file.Path))); 448var reference = new AnalyzerFileReference(location, new MockShadowCopyAnalyzerAssemblyLoader(ImmutableDictionary<string, string>.Empty.Add(location, file.Path))); 485var analyzer1 = new AnalyzerFileReference(file1.Path, TestAnalyzerAssemblyLoader.LoadNotImplemented); 486var analyzer2 = new AnalyzerFileReference(file2.Path, TestAnalyzerAssemblyLoader.LoadNotImplemented); 567var tempCorlibXml = tempDir.CreateFile(Path.ChangeExtension(tempCorlib.Path, "xml")); 583.AddMetadataReference(MetadataReference.CreateFromFile(tempCorlib.Path)) 701return new AnalyzerFileReference(original, new MockShadowCopyAnalyzerAssemblyLoader(ImmutableDictionary<string, string>.Empty.Add(original, shadow.Path)));
Services\ServiceHubServicesTests.cs (2)
357p1, VersionStamp.Create(), "p1", "p1", LanguageNames.CSharp, outputFilePath: file.Path, 361metadataReferences: [MetadataReference.CreateFromFile(file.Path)])
VBCSCompiler.UnitTests (29)
AnalyzerConsistencyCheckerTests.cs (12)
72var emitResult = comp.Emit(file.Path); 120new CommandLineAnalyzerReference(mvidAlpha1.Path), 121new CommandLineAnalyzerReference(mvidAlpha2.Path)); 145ImmutableArray.Create(new CommandLineAnalyzerReference(mvidAlpha1.Path)), 150File.Delete(mvidAlpha1.Path); 152Assert.Equal(mvidAlpha1.Path, mvidAlpha2.Path); 155ImmutableArray.Create(new CommandLineAnalyzerReference(mvidAlpha2.Path)), 165Assert.Contains(mvidAlpha1.Path, errorMessage); 166Assert.Contains(mvidAlpha2.Path, errorMessage); 213Assert.True(assemblyLoader.LoadFromPath(dllFile.Path).GlobalAssemblyCache); 240var analyzerReferences = ImmutableArray.Create(new CommandLineAnalyzerReference(compFile.Path));
CompilerServerTests.cs (15)
223var srcFile = tempDir.CreateFile("test.cs").WriteAllText(source).Path; 264var result = ProcessUtilities.Run(file.Path, "", Path.GetDirectoryName(file.Path)); 341var srcFile = _tempDirectory.CreateFile("test.cs").WriteAllText("♕").Path; 363var srcFile = _tempDirectory.CreateFile("test.vb").WriteAllText("♕").Path; 387var srcFile = _tempDirectory.CreateFile("test.vb").WriteAllText("♕").Path; 1148var srcFile = _tempDirectory.CreateFile("test.cs").WriteAllText("♕").Path; 1170var srcFile = _tempDirectory.CreateFile("test.vb").WriteAllText(@"♕").Path; 1197var srcFile = _tempDirectory.CreateFile("test.cs").WriteAllText("♕").Path; 1219var srcFile = _tempDirectory.CreateFile("test.vb").WriteAllText(@"♕").Path; 1304var srcFile = _tempDirectory.CreateFile("test.cs").WriteAllText("♕").Path; 1328var srcFile = _tempDirectory.CreateFile("test.cs").WriteAllText("♕").Path; 1394var srcFile = _tempDirectory.CreateFile("test.cs").WriteAllText("").Path; 1428var srcFile = _tempDirectory.CreateFile("test.vb").WriteAllText("").Path; 1464var serverExe = dir.CopyFile(compilerServerExecutable).Path;
TouchedFileLoggingTests.cs (2)
58var source1 = Temp.CreateFile().WriteAllText(HelloWorldCS).Path; 109var source1 = Temp.CreateFile().WriteAllText(HelloWorldVB).Path;