1251 references to Path
InteractiveHost.UnitTests (37)
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 (30)
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}}".
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (388)
CommandLineTests.cs (354)
147var cmd = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/errorlog:errorlog", $"/doc:{docName}", "/warnaserror", src.Path });
167var cmd = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/t:library", "/preferreduilang:en", $"/doc:{docName}", src.Path });
200"/analyzerconfig:" + analyzerConfig.Path,
201src.Path });
203Assert.Equal(analyzerConfig.Path, Assert.Single(cmd.Arguments.AnalyzerConfigPaths));
243"/analyzerconfig:" + modifyPath(editorconfig.Path, doubleSlashAnalyzerConfig),
244modifyPath(src.Path, doubleSlashSource),
292"/analyzerconfig:" + analyzerConfig.Path,
295"/additionalfile:" + additionalFile.Path,
296src.Path });
298Assert.Equal(analyzerConfig.Path, Assert.Single(cmd.Arguments.AnalyzerConfigPaths));
345"/analyzerconfig:" + analyzerConfig.Path,
346src.Path });
348Assert.Equal(analyzerConfig.Path, Assert.Single(cmd.Arguments.AnalyzerConfigPaths));
354$@"warning InvalidSeverityInAnalyzerConfig: The diagnostic 'cs0169' was given an invalid severity 'garbage' in the analyzer config file at '{analyzerConfig.Path}'.
381"/analyzerconfig:" + analyzerConfig1.Path,
382"/analyzerconfig:" + analyzerConfig2.Path,
383src.Path
401var cmd = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", src.Path });
421var cmd = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/codepage:932", src.Path });
454").Path;
876string tmpFileName = Temp.CreateFile().WriteAllBytes(new byte[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }).Path;
1248CleanupAllGeneratedFiles(file1.Path);
1249CleanupAllGeneratedFiles(file2.Path);
1250CleanupAllGeneratedFiles(file3.Path);
1251CleanupAllGeneratedFiles(file4.Path);
1252CleanupAllGeneratedFiles(file5.Path);
2251AssertEx.Equal(File.ReadAllBytes(sl.Path), blob);
2256CleanupAllGeneratedFiles(src.Path);
2280AssertEx.Equal(File.ReadAllBytes(sl.Path), blob);
2284CleanupAllGeneratedFiles(src.Path);
2309CleanupAllGeneratedFiles(src.Path);
2429expectedEmbeddedMap.Add(src.Path, embed_cs);
2434expectedEmbeddedMap.Add(src2.Path, embed2_cs);
2439expectedEmbeddedMap.Add(txt.Path, embed_xyz);
2462CleanupAllGeneratedFiles(src.Path);
2780CleanupAllGeneratedFiles(file.Path);
2802CleanupAllGeneratedFiles(file.Path);
2827var parsedArgs = DefaultParse(new string[] { @"/ruleset:" + file.Path, "a.cs" }, WorkingDirectory);
2829Assert.Equal(expected: file.Path, actual: parsedArgs.RuleSetPath);
2853var parsedArgs = DefaultParse(new string[] { @"/ruleset:" + "\"" + file.Path + "\"", "a.cs" }, WorkingDirectory);
2855Assert.Equal(expected: file.Path, actual: parsedArgs.RuleSetPath);
2882parsedArgs = DefaultParse(new string[] { @"/ruleset:" + file.Path, "a.cs" }, WorkingDirectory);
2885Assert.Equal(expected: file.Path, actual: parsedArgs.RuleSetPath);
2890Assert.Equal(file.Path, (string)err.Arguments[0]);
2922CleanupAllGeneratedFiles(file.Path);
2950var csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/preferreduilang:en", "/t:library", "/a:" + Assembly.GetExecutingAssembly().Location, "a.cs", "/ruleset:" + ruleSetFile.Path });
2957CleanupAllGeneratedFiles(file.Path);
2987"/ruleset:" + ruleSetFile.Path, "/warnaserror+", "/nowarn:8032" });
2998"/warnaserror+", "/ruleset:" + ruleSetFile.Path, "/nowarn:8032" });
3005CleanupAllGeneratedFiles(file.Path);
3506"/ruleset:" + ruleSetFile.Path, "/warn:0" });
3517"/warn:0", "/ruleset:" + ruleSetFile.Path });
3524CleanupAllGeneratedFiles(file.Path);
3677CleanupAllGeneratedFiles(file.Path);
3697CleanupAllGeneratedFiles(file.Path);
4320var srcDirectory = Path.GetDirectoryName(srcFile.Path);
4331var silverlight = Temp.CreateFile().WriteAllBytes(Silverlight.System).Path;
4332var net4_0dll = Temp.CreateFile().WriteAllBytes(Net461.Resources.System).Path;
4340"/appconfig:" + appConfigFile.Path,
4341srcFile.Path }).Run(outWriter);
4345CleanupAllGeneratedFiles(srcFile.Path);
4346CleanupAllGeneratedFiles(appConfigFile.Path);
4353var srcDirectory = Path.GetDirectoryName(srcFile.Path);
4360srcFile.Path }).Run(outWriter);
4364CleanupAllGeneratedFiles(srcFile.Path);
4480var csc = CreateCSharpCompiler(null, dir.Path, new[] { "/modulename:hocusPocus ", "/out:" + exeName + " ", file1.Path });
4505CleanupAllGeneratedFiles(file1.Path);
4749CleanupAllGeneratedFiles(src.Path);
4768CleanupAllGeneratedFiles(src.Path);
4776var filePath = tempFolder.CreateFile("temp").Path;
4796CleanupAllGeneratedFiles(src.Path);
5884public class Mod { }").Path;
5889public class Mod { }").Path;
5894class Test { static void Main() {} }").Path;
5931string source1 = Temp.CreateFile(prefix: "", extension: ".cs").WriteAllText(@"public static class Extensions { public static bool EB(this bool b) { return b; } }").Path;
5932string source2 = Temp.CreateFile(prefix: "", extension: ".cs").WriteAllText(@"class C { static void Main() {} }").Path;
5951string source1 = Temp.CreateFile(prefix: "", extension: ".cs").WriteAllText(@"class Mod { }").Path;
5952string source2 = Temp.CreateFile(prefix: "", extension: ".cs").WriteAllText(@"class C { static void Main() {} }").Path;
6131var srcFile = Temp.CreateFile().WriteAllText("\u265A").Path;
6135var output = ProcessUtilities.RunAndGetOutput("cmd", "/C \"" + s_CSharpCompilerExecutable + "\" /nologo /preferreduilang:en /t:library " + srcFile + " > " + tempOut.Path, expectedRetCode: 1);
6140CleanupAllGeneratedFiles(tempOut.Path);
6146var srcFile = Temp.CreateFile().WriteAllText("\u265A").Path;
6150var output = ProcessUtilities.RunAndGetOutput("cmd", "/C \"" + s_CSharpCompilerExecutable + "\" /utf8output /nologo /preferreduilang:en /t:library " + srcFile + " > " + tempOut.Path, expectedRetCode: 1);
6155CleanupAllGeneratedFiles(tempOut.Path);
6175CleanupAllGeneratedFiles(aCs.Path);
6189CleanupAllGeneratedFiles(aCs.Path);
6203CleanupAllGeneratedFiles(aCs.Path);
6303var kfile = "/keyfile:" + snkFile.Path;
6308parsedArgs = DefaultParse(new[] { "/t:library", kfile, "/r:" + cs1698a.Path, "CS1698b.cs" }, WorkingDirectory);
6311parsedArgs = DefaultParse(new[] { "/t:library", kfile, "/r:" + cs1698b.Path, "/out:" + cs1698a.Path, "CS1698.cs" }, WorkingDirectory);
6321CleanupAllGeneratedFiles(snkFile.Path);
6322CleanupAllGeneratedFiles(cs1698a.Path);
6323CleanupAllGeneratedFiles(cs1698b.Path);
6324CleanupAllGeneratedFiles(cs1698.Path);
6330var binaryPath = Temp.CreateFile().WriteAllBytes(Net461.Resources.mscorlib).Path;
6415").Path;
6420").Path;
6439").Path;
6448").Path;
6453").Path;
6461").Path;
6467").Path;
6514").Path;
6519").Path;
6555").Path;
6561").Path;
6596").Path;
6602").Path;
6946CleanupAllGeneratedFiles(file.Path);
6970CleanupAllGeneratedFiles(file.Path);
6993CleanupAllGeneratedFiles(file.Path);
7021CleanupAllGeneratedFiles(file.Path);
7094CleanupAllGeneratedFiles(file1.Path);
7095CleanupAllGeneratedFiles(file2.Path);
7117CleanupAllGeneratedFiles(file.Path);
7217CleanupAllGeneratedFiles(file.Path);
7245CleanupAllGeneratedFiles(file.Path);
7273CleanupAllGeneratedFiles(file.Path);
7299CleanupAllGeneratedFiles(file.Path);
7325CleanupAllGeneratedFiles(file.Path);
7489CleanupAllGeneratedFiles(file.Path);
7528CleanupAllGeneratedFiles(file.Path);
7797Path.GetFileName(sourceFile.Path),
7807string.Format("/win32manifest:{0}", Path.GetFileName(manifestFile.Path)),
7808Path.GetFileName(sourceFile.Path),
7850}").Path;
7854").Path;
7897}").Path;
7901").Path;
7931}").Path;
7935").Path;
7965}").Path;
7969").Path;
8005outWriter.ToString().Replace(Path.GetFileName(src.Path), "{FILE}").Trim());
8014CleanupAllGeneratedFiles(src.Path);
8020return Temp.CreateFile().WriteAllBytes(cscRsp).Path;
8159string OriginalSource = src.Path;
8169CleanupAllGeneratedFiles(src.Path);
8229CleanupAllGeneratedFiles(src.Path);
8272CleanupAllGeneratedFiles(src.Path);
8273CleanupAllGeneratedFiles(xml.Path);
8343CleanupAllGeneratedFiles(src.Path);
8344CleanupAllGeneratedFiles(xml.Path);
8383}").Path;
8520}").Path;
8559").Path;
8583").Path;
8617").Path;
8636string source = Temp.CreateFile(prefix: "", extension: ".cs").WriteAllText(@"class Test { static void Main() {} }").Path;
8637string badres = Temp.CreateFile().WriteAllBytes(TestResources.DiagnosticTests.badresfile).Path;
8661string source = Temp.CreateFile(prefix: "", extension: ".cs").WriteAllText(@"class Test { static void Main() {} }").Path;
8662string badres = Temp.CreateFile().WriteAllBytes(new byte[] { 0, 0 }).Path;
8690}").Path;
8712} ").Path;
8756using (var stream = File.OpenWrite(exe.Path))
8763using (var stream = File.OpenWrite(pdb.Path))
8769int exitCode1 = CreateCSharpCompiler(null, dir.Path, new[] { "/debug:full", "/out:Program.exe", source1.Path }).Run(outWriter);
8772ValidateZeroes(exe.Path, oldSize);
8773ValidateZeroes(pdb.Path, oldSize);
8775int exitCode2 = CreateCSharpCompiler(null, dir.Path, new[] { "/debug:full", "/out:Program.exe", source2.Path }).Run(outWriter);
8778using (var peFile = File.OpenRead(exe.Path))
8780PdbValidation.ValidateDebugDirectory(peFile, null, pdb.Path, hashAlgorithm: default, hasEmbeddedPdb: false, isDeterministic: false);
8783Assert.True(new FileInfo(exe.Path).Length < oldSize);
8784Assert.True(new FileInfo(pdb.Path).Length < oldSize);
8786int exitCode3 = CreateCSharpCompiler(null, dir.Path, new[] { "/debug:full", "/out:Program.exe", source3.Path }).Run(outWriter);
8789using (var peFile = File.OpenRead(exe.Path))
8791PdbValidation.ValidateDebugDirectory(peFile, null, pdb.Path, hashAlgorithm: default, hasEmbeddedPdb: false, isDeterministic: false);
8827var fsDll = new FileStream(libDll.Path, FileMode.Open, FileAccess.Read, FileShare.Read | FileShare.Delete);
8828var fsPdb = new FileStream(libPdb.Path, FileMode.Open, FileAccess.Read, FileShare.Read | FileShare.Delete);
8831int exitCode = CreateCSharpCompiler(null, dir.Path, new[] { "/target:library", "/debug:full", libSrc.Path }).Run(outWriter);
8839AssertEx.Equal(new byte[] { 0x4D, 0x5A }, ReadBytes(libDll.Path, 2));
8842AssertEx.Equal(new byte[] { 0x4D, 0x69 }, ReadBytes(libPdb.Path, 2));
8867var fsDll = new FileStream(libDll.Path, FileMode.Open, FileAccess.Read, FileShare.Read | FileShare.Delete);
8868var fsPdb = new FileStream(libPdb.Path, FileMode.Open, FileAccess.Read, FileShare.Read | FileShare.Delete);
8877var output = ProcessUtilities.RunAndGetOutput(s_CSharpCompilerExecutable, $"/target:library /debug:portable \"{libSrc.Path}\"", startFolder: dir.ToString());
8893using (var fsNewDll = File.OpenRead(libDll.Path))
8899AssertEx.Equal(new[] { (byte)'B', (byte)'S', (byte)'J', (byte)'B' }, ReadBytes(libPdb.Path, 4));
8908File.Delete(libSrc.Path);
8909File.Delete(libDll.Path);
8910File.Delete(libPdb.Path);
8933File.SetAttributes(libDll.Path, FileAttributes.ReadOnly);
8935var fsDll = new FileStream(libDll.Path, FileMode.Open, FileAccess.Read, FileShare.Read | FileShare.Delete);
8938int exitCode = CreateCSharpCompiler(null, dir.Path, new[] { "/target:library", "/preferreduilang:en", libSrc.Path }).Run(outWriter);
8939Assert.Contains($"error CS2012: Cannot open '{libDll.Path}' for writing", outWriter.ToString());
8941AssertEx.Equal(new[] { (byte)'D', (byte)'L', (byte)'L' }, ReadBytes(libDll.Path, 3));
8957int exitCode = CreateCSharpCompiler(null, dir.Path, new[] { "/target:library", "/preferreduilang:en", libSrc.Path }).Run(outWriter);
9161} ").Path;
9205string sourcePath = Temp.CreateFile(prefix: "", extension: ".cs").WriteAllText(source).Path;
9230var sourcePath = Temp.CreateFile(directory: WorkingDirectory, extension: ".cs").WriteAllText(source).Path;
9303commandLineArgs = new[] { @"tmpDir\a.cs", tempFile.Path };
9314commandLineArgs = new[] { tempFile.Path, @"tmpDir\*.cs" };
9329commandLineArgs = new[] { "/preferreduilang:en", tempFile.Path, "tmpDir\a.cs" };
9334commandLineArgs = new[] { tempFile.Path, @"tmpDi\r*a?.cs" };
9343commandLineArgs = new[] { tempFile.Path, currentDrive + @":a.cs" };
9349commandLineArgs = new[] { "/preferreduilang:en", tempFile.Path, @":a.cs" };
9354CleanupAllGeneratedFiles(tempFile.Path);
9427var srcDirectory = Path.GetDirectoryName(srcFile.Path);
9433new[] { "/reportanalyzer", "/t:library", srcFile.Path },
9444CleanupAllGeneratedFiles(srcFile.Path);
9485var srcDirectory = Path.GetDirectoryName(srcFile.Path);
9487var args = new List<string>() { "/reportanalyzer", "/t:library", "/a:" + typeof(DoNothingGenerator).Assembly.Location, srcFile.Path };
9509CleanupAllGeneratedFiles(srcFile.Path);
9518var srcDirectory = Path.GetDirectoryName(srcFile.Path);
9527new[] { "/reportanalyzer", "/t:library", srcFile.Path },
9543CleanupAllGeneratedFiles(srcFile.Path);
9558workingDirectory: Path.GetDirectoryName(srcFile.Path),
9559args: new[] { "/errorlog:" + errorLog.Path, "/warnaserror+", "/nologo", "/t:library", srcFile.Path },
9569CleanupAllGeneratedFiles(srcFile.Path);
9570CleanupAllGeneratedFiles(errorLog.Path);
9578var srcDirectory = Path.GetDirectoryName(srcFile.Path);
9581var csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/t:library", srcFile.Path },
9595CleanupAllGeneratedFiles(srcFile.Path);
9603var srcDirectory = Path.GetDirectoryName(srcFile.Path);
9606var csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/t:library", $"/warnaserror:{AnalyzerExecutor.AnalyzerExceptionDiagnosticId}", srcFile.Path },
9617CleanupAllGeneratedFiles(srcFile.Path);
9625var srcDirectory = Path.GetDirectoryName(srcFile.Path);
9628var csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/t:library", srcFile.Path },
9639CleanupAllGeneratedFiles(srcFile.Path);
9732").Path;
9783DefaultParse(new[] { "/lib:" + invalidPath, sourceFile.Path }, WorkingDirectory).Errors.Verify(
9786DefaultParse(new[] { "/lib:" + nonExistentPath, sourceFile.Path }, WorkingDirectory).Errors.Verify(
9791DefaultParse(new[] { sourceFile.Path }, WorkingDirectory, additionalReferenceDirectories: invalidPath).Errors.Verify(
9794DefaultParse(new[] { sourceFile.Path }, WorkingDirectory, additionalReferenceDirectories: nonExistentPath).Errors.Verify(
9798CleanupAllGeneratedFiles(sourceFile.Path);
9824string filePath = Temp.CreateFile().WriteAllText(@"class C {}").Path;
9997string filePath = Temp.CreateFile().WriteAllText(source).Path;
10047string filePath = Temp.CreateFile().WriteAllText(source).Path;
10118CleanupAllGeneratedFiles(src.Path);
10177CleanupAllGeneratedFiles(src.Path);
10243CleanupAllGeneratedFiles(src.Path);
10350CleanupAllGeneratedFiles(src.Path);
10353void RunWithCache() => VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference: false, additionalFlags: new[] { "/langversion:preview", "/features:enable-generator-cache", "/additionalFile:" + additionalFile.Path }, generators: new[] { generator.AsSourceGenerator() }, driverCache: cache, analyzers: null);
10447CleanupAllGeneratedFiles(src.Path);
10450void RunWithCache() => VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference: false, additionalFlags: new[] { "/langversion:preview", "/features:enable-generator-cache", "/analyzerConfig:" + editorconfig.Path, "/analyzerConfig:" + globalconfig.Path }, generators: new[] { generator.AsSourceGenerator() }, driverCache: cache, analyzers: null);
10484CleanupAllGeneratedFiles(src.Path);
10524CleanupAllGeneratedFiles(src.Path);
10555sourceFile.Path
10652CleanupAllGeneratedFiles(file.Path);
10764CleanupAllGeneratedFiles(file.Path);
10907CleanupAllGeneratedFiles(file.Path);
11105CleanupAllGeneratedFiles(file.Path);
11189CleanupAllGeneratedFiles(file.Path);
11293CleanupAllGeneratedFiles(file.Path);
11392CleanupAllGeneratedFiles(src.Path);
11740var output = ProcessUtilities.RunAndGetOutput(csc32exe.Path, $@"/nologo /debug:full /deterministic /out:Program.exe /pathmap:""{dir32.Path}""=X:\ ""{sourceFile.Path}""", expectedRetCode: 0, startFolder: dir32.Path);
11743output = ProcessUtilities.RunAndGetOutput(s_CSharpCompilerExecutable, $@"/nologo /debug:full /deterministic /out:Program.exe /pathmap:""{dir64.Path}""=X:\ ""{sourceFile.Path}""", expectedRetCode: 0, startFolder: dir64.Path);
12014var cscPath = dir.CopyFile(s_CSharpCompilerExecutable).Path;
12490string filePath = Temp.CreateFile().WriteAllText("").Path;
12510string filePath = Temp.CreateFile().WriteAllText("").Path;
12573CleanupAllGeneratedFiles(srcFile.Path);
12635CleanupAllGeneratedFiles(srcFile.Path);
12691CleanupAllGeneratedFiles(srcFile.Path);
12778CleanupAllGeneratedFiles(sourceFile.Path);
12879CleanupAllGeneratedFiles(sourceFile.Path);
12989CleanupAllGeneratedFiles(sourceFile.Path);
13012CleanupAllGeneratedFiles(srcFile.Path);
13038CleanupAllGeneratedFiles(srcFile.Path);
13105CleanupAllGeneratedFiles(srcFile.Path);
13133CleanupAllGeneratedFiles(srcFile.Path);
13393"/analyzerconfig:" + analyzerConfig.Path,
13394src.Path };
13413arguments = arguments.Append($"/ruleset:{rulesetFile.Path}");
13419Assert.Equal(analyzerConfig.Path, Assert.Single(cmd.Arguments.AnalyzerConfigPaths));
13511additionalArgs = additionalArgs.Append("/analyzerconfig:" + analyzerConfig.Path).ToArray();
13561additionalArgs = additionalArgs.Append("/ruleset:" + rulesetFile.Path).ToArray();
13649"/analyzerconfig:" + analyzerConfig.Path,
13650src.Path };
13664Assert.Equal(analyzerConfig.Path, Assert.Single(cmd.Arguments.AnalyzerConfigPaths));
13709output = VerifyOutput(dir, src, additionalFlags: new[] { "/nullable", "/analyzerconfig:" + analyzerConfig.Path }, expectedWarningCount: 1, includeCurrentAssemblyAsAnalyzerReference: false);
13718output = VerifyOutput(dir, src, additionalFlags: new[] { "/nullable", "/analyzerconfig:" + analyzerConfig.Path }, expectedWarningCount: 1, includeCurrentAssemblyAsAnalyzerReference: false);
13726output = VerifyOutput(dir, src, additionalFlags: new[] { "/nullable", "/analyzerconfig:" + analyzerConfig.Path }, expectedWarningCount: 1, includeCurrentAssemblyAsAnalyzerReference: false);
13748var args = new[] { "/nologo", "/t:library", "/preferreduilang:en", src.Path };
13787var args = new[] { "/warnaserror+", $"/warnaserror-:{diagnosticId}", "/nologo", "/t:library", "/preferreduilang:en", src.Path };
13878additionalFlags = additionalFlags.Append($"/analyzerconfig:{analyzerConfig.Path}").ToArray();
13926CleanupAllGeneratedFiles(src.Path);
13981CleanupAllGeneratedFiles(src.Path);
14012CleanupAllGeneratedFiles(src.Path);
14049<file id=""1"" name=""{src.Path}"" language=""C#"" checksumAlgorithm=""SHA256"" checksum=""A0-78-BB-A8-E8-B1-E1-3B-E8-63-80-7D-CE-CC-4B-0D-14-EF-06-D3-9B-14-52-E1-95-C6-64-D1-36-EC-7C-25"" />
14095CleanupAllGeneratedFiles(src.Path);
14125CleanupAllGeneratedFiles(src.Path);
14159CleanupAllGeneratedFiles(src.Path);
14197CleanupAllGeneratedFiles(src.Path);
14228options: TestOptions.DebugDll.WithCryptoKeyFile(Path.GetFileName(snk.Path)).WithStrongNameProvider(virtualSnProvider),
14267CleanupAllGeneratedFiles(src.Path);
14288CleanupAllGeneratedFiles(src.Path);
14311CleanupAllGeneratedFiles(src.Path);
14380CleanupAllGeneratedFiles(src.Path);
14408CleanupAllGeneratedFiles(src.Path);
14476CleanupAllGeneratedFiles(src.Path);
14545CleanupAllGeneratedFiles(src.Path);
14626CleanupAllGeneratedFiles(src.Path);
14645VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference: false, additionalFlags: new[] { "/analyzerconfig:" + analyzerConfig.Path }, generators: new[] { generator }, analyzers: null);
14708"/analyzerconfig:" + analyzerConfig1.Path,
14709"/analyzerconfig:" + analyzerConfig2.Path,
14710"/analyzerconfig:" + analyzerConfig3.Path,
14712src.Path
14776new[] { "/t:library", "/nologo", "/warnaserror+", src.Path },
14796new[] { "/t:library", "/nologo", "/nowarn:CS8785", src.Path },
14821new[] { "/t:library", "/nologo", "/warnaserror+", src.Path },
14841new[] { "/t:library", "/nologo", "/nowarn:CS8784", src.Path },
14876VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference: false, additionalFlags: new[] { "/additionalfile:" + additionalFile.Path, "/langversion:preview", "/out:embed.exe" }, generators: new[] { generator }, analyzers: null);
14879CleanupAllGeneratedFiles(src.Path);
14921new[] { "/nologo", "/t:library", srcFile.Path },
14927CleanupAllGeneratedFiles(srcFile.Path);
14950"/analyzerconfig:" + analyzerConfig1.Path,
14951"/analyzerconfig:" + analyzerConfig2.Path,
14952src.Path
14980var output = VerifyOutput(dir, src, additionalFlags: new[] { "/analyzerconfig:" + analyzerConfig.Path + "," + analyzerConfig2.Path }, expectedWarningCount: 1, includeCurrentAssemblyAsAnalyzerReference: false);
14999output = VerifyOutput(dir, src, additionalFlags: new[] { "/analyzerconfig:" + analyzerConfig.Path + "," + analyzerConfig2.Path }, expectedWarningCount: 1, includeCurrentAssemblyAsAnalyzerReference: false);
15030"/analyzerconfig:" + analyzerConfig.Path,
15031"/analyzerconfig:" + globalConfig.Path,
15034"/additionalfile:" + additionalFile.Path,
15035src.Path });
15137VerifyOutput(dir, src, additionalFlags: new[] { "/warnaserror+", "/analyzerconfig:" + globalConfig.Path }, includeCurrentAssemblyAsAnalyzerReference: false);
15160additionalFlags = additionalFlags.Append("/analyzerconfig:" + globalConfig.Path).ToArray();
15194[{PathUtilities.NormalizeWithForwardSlash(src.Path)}]
15198VerifyOutput(dir, src, additionalFlags: new[] { "/nowarn:0164", "/analyzerconfig:" + globalConfig.Path }, expectedErrorCount: 0, includeCurrentAssemblyAsAnalyzerReference: false);
15215VerifyOutput(dir, src, additionalFlags: new[] { "/analyzerconfig:" + globalConfig.Path }, expectedErrorCount: 1, includeCurrentAssemblyAsAnalyzerReference: false, analyzers: new[] { new WarningDiagnosticAnalyzer() });
15217VerifyOutput(dir, src, additionalFlags: new[] { "/nowarn:Warning01", "/analyzerconfig:" + globalConfig.Path }, includeCurrentAssemblyAsAnalyzerReference: false, analyzers: new[] { new WarningDiagnosticAnalyzer() });
15237additionalFlags: new[] { "/additionalfile:" + additionalFile.Path },
15318additionalArgs = additionalArgs.Append("/analyzerconfig:" + analyzerConfig.Path).ToArray();
15439string path1 = additionalFile1.Path;
15440string path2 = additionalFile2?.Path ?? Path.Combine(srcDirectory.Path, additionalFilePath2);
15491var output = VerifyOutput(dir, src, additionalFlags: new[] { "/analyzer:" + notAnalyzer.Path }, expectedWarningCount: 1, includeCurrentAssemblyAsAnalyzerReference: false);
15495VerifyOutput(dir, src, additionalFlags: new[] { "/analyzer:" + notAnalyzer.Path, "/nowarn:CS8034" }, expectedWarningCount: 0, includeCurrentAssemblyAsAnalyzerReference: false);
15498output = VerifyOutput(dir, src, additionalFlags: new[] { "/analyzer:" + notAnalyzer.Path, "/warnAsError:CS8034" }, expectedErrorCount: 1, includeCurrentAssemblyAsAnalyzerReference: false);
15515var output = VerifyOutput(dir, src, additionalFlags: new[] { "/analyzer:" + notAnalyzer.Path }, expectedWarningCount: 1, includeCurrentAssemblyAsAnalyzerReference: false);
15519VerifyOutput(dir, src, additionalFlags: new[] { "/analyzer:" + notAnalyzer.Path, "/analyzerConfig:" + globalconfig.Path }, includeCurrentAssemblyAsAnalyzerReference: false);
15556src.Path });
15567"/analyzerconfig:" + analyzerConfig.Path,
15568src.Path });
15570Assert.Equal(analyzerConfig.Path, Assert.Single(cmd.Arguments.AnalyzerConfigPaths));
15608src.Path });
15620src.Path });
15690src.Path });
15701"/analyzerconfig:" + analyzerConfig.Path,
15702src.Path });
15704Assert.Equal(analyzerConfig.Path, Assert.Single(cmd.Arguments.AnalyzerConfigPaths));
15743src.Path });
15755src.Path });
15821"/analyzerconfig:" + analyzerConfig.Path,
15822src.Path });
15860"/analyzerconfig:" + analyzerConfig.Path,
15861src.Path });
15900"/analyzerconfig:" + analyzerConfig.Path,
15901src.Path });
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (6)
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (10)
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (1)
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)}
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (1)
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (76)
Microsoft.CodeAnalysis.CSharp.Test.Utilities (1)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (8)
Microsoft.CodeAnalysis.Features.Test.Utilities (1)
Microsoft.CodeAnalysis.Features.UnitTests (83)
EditAndContinue\EditAndContinueWorkspaceServiceTests.cs (73)
68var sourceTreeA1 = SyntaxFactory.ParseSyntaxTree(SourceText.From(sourceBytesA1, sourceBytesA1.Length, encodingA, SourceHashAlgorithms.Default), TestOptions.Regular, sourceFileA.Path);
69var sourceTreeB1 = SyntaxFactory.ParseSyntaxTree(SourceText.From(sourceBytesB1, sourceBytesB1.Length, encodingB, SourceHashAlgorithms.Default), TestOptions.Regular, sourceFileB.Path);
70var sourceTreeC1 = SyntaxFactory.ParseSyntaxTree(SourceText.From(sourceBytesC1, sourceBytesC1.Length, encodingC, SourceHashAlgorithm.Sha1), TestOptions.Regular, sourceFileC.Path);
92loader: new WorkspaceFileTextLoader(solution.Services, sourceFileA.Path, encodingA),
93filePath: sourceFileA.Path));
99loader: new WorkspaceFileTextLoader(solution.Services, sourceFileB.Path, encodingB),
100filePath: sourceFileB.Path));
106loader: new WorkspaceFileTextLoader(solution.Services, sourceFileC.Path, encodingC),
107filePath: sourceFileC.Path));
113loader: new WorkspaceFileTextLoader(solution.Services, sourceFileE.Path, encodingE),
114filePath: sourceFileE.Path));
135filePath: sourceFileD.Path));
153solution = solution.WithDocumentTextLoader(documentIdB, new WorkspaceFileTextLoader(solution.Services, sourceFileB.Path, encodingB), PreservationMode.PreserveValue);
207solution = solution.WithProjectOutputFilePath(document.Project.Id, moduleFile.Path);
208_mockCompilationOutputs.Add(document.Project.Id, new CompilationOutputFiles(moduleFile.Path));
319solution = solution.WithProjectOutputFilePath(projectId, moduleFile.Path).AddDocument(documentInfo);
321_mockCompilationOutputs.Add(projectId, new CompilationOutputFiles(moduleFile.Path));
394var sourceFilePath = dir.CreateFile(sourceFileName).WriteAllText(source, Encoding.UTF8).Path;
491using var stream = File.OpenRead(moduleFile.Path);
507_mockCompilationOutputs.Add(projectId, new CompilationOutputFiles(moduleFile.Path));
528[$"proj: <no location>: Error ENC1001: {string.Format(FeaturesResources.ErrorReadingFile, moduleFile.Path, expectedErrorMessage)}"],
578AddDocument("a.cs", CreateText(source1), filePath: sourceFile.Path);
583var moduleId = EmitAndLoadLibraryToDebuggee(project.Id, source1, sourceFilePath: sourceFile.Path);
609[$"proj: {document2.FilePath}: (0,0)-(0,0): Error ENC1006: {string.Format(FeaturesResources.UnableToReadSourceFileOrPdb, sourceFile.Path)}"],
632AddDocument("a.cs", SourceText.From(source1, Encoding.UTF8, SourceHashAlgorithm.Sha1), filePath: sourceFile.Path);
637var moduleId = EmitAndLoadLibraryToDebuggee(project.Id, source1, sourceFilePath: sourceFile.Path, checksumAlgorithm: SourceHashAlgorithms.Default);
646using var fileLock = File.Open(sourceFile.Path, FileMode.Open, FileAccess.Read, FileShare.None);
657[$"test: {document1.FilePath}: (0,0)-(0,0): Error ENC1006: {string.Format(FeaturesResources.UnableToReadSourceFileOrPdb, sourceFile.Path)}"],
691AddDocument("test.cs", CreateText(sourceA), filePath: sourceFileA.Path);
697EmitAndLoadLibraryToDebuggee(project.Id, sourceA, sourceFilePath: sourceFileA.Path);
707var documentB = project.AddTestDocument(sourceB, path: sourceFileB.Path);
756AddTestDocument(sourceA, sourceFileA.Path).Project.
757AddTestDocument(sourceB, sourceFileA.Path, out var documentBId).Project.Solution;
787AddTestDocument(source1, sourceFile1.Path, out var documentBId).Project.Solution;
798solution = solution.AddTestDocument(projectId, source2, sourceFile2.Path, out var document2Id).Project.Solution;
848var moduleId = EmitLibrary(project.Id, source1, sourceFilePath: sourceFile.Path);
855var document0 = project.AddTestDocument(source0, path: sourceFile.Path);
1003AddDocument(documentId, "test.cs", SourceText.From(source1, encoding, SourceHashAlgorithm.Sha1), filePath: sourceFile.Path);
1006var moduleId = EmitAndLoadLibraryToDebuggee(projectId, source1, sourceFilePath: sourceFile.Path, encoding: encoding, checksumAlgorithm: SourceHashAlgorithm.Sha256);
1231var moduleId = EmitAndLoadLibraryToDebuggee(projectId, source0, sourceFilePath: sourceFile.Path);
1237var document1 = project.AddTestDocument(source1, path: sourceFile.Path);
1272moduleId = EmitAndLoadLibraryToDebuggee(projectId, source0, sourceFilePath: sourceFile.Path);
1335AddDocument("test.cs", CreateText(source1), filePath: sourceFile.Path);
1340var moduleId = EmitAndLoadLibraryToDebuggee(project.Id, source1, sourceFilePath: sourceFile.Path);
1378AddDocument("test.cs", CreateText(source1), filePath: sourceFile.Path);
1383var moduleId = EmitLibrary(project.Id, source1, sourceFilePath: sourceFile.Path);
1994var mvidA = EmitAndLoadLibraryToDebuggee(projectAId, sourceA1, sourceFilePath: sourceFileA.Path, assemblyName: "A");
1995var mvidB = EmitAndLoadLibraryToDebuggee(projectBId, sourceB1, sourceFilePath: sourceFileB.Path, assemblyName: "B");
2006sourceFileA.Path,
2011sourceFileB.Path,
2021AddTestDocument(sourceB2, path: sourceFileB.Path);
2329AddDocument("test.cs", CreateText("class C1 { void M() { System.Console.WriteLine(0); } }"), filePath: sourceFile.Path);
2338Assert.Equal(sourceFile.Path, filePath);
2346var moduleId = EmitAndLoadLibraryToDebuggee(documentId.ProjectId, source1, sourceFilePath: sourceFile.Path);
2375solution = solution.WithDocumentText(documentId, CreateTextFromFile(sourceFile.Path));
2416AddDocument("test.cs", CreateText(source2), filePath: sourceFile.Path);
2423var moduleId = EmitAndLoadLibraryToDebuggee(project.Id, source1, sourceFilePath: sourceFile.Path);
2461$"{project.FilePath}: (0,0)-(0,0): Warning ENC1008: {string.Format(FeaturesResources.Changing_source_file_0_in_a_stale_project_has_no_effect_until_the_project_is_rebuit, sourceFile.Path)}"
2492var moduleId = EmitAndLoadLibraryToDebuggee(project.Id, source1, sourceFilePath: sourceFile.Path);
2515var document1 = project.AddDocument("test.cs", sourceText1, filePath: sourceFile.Path);
2550AddDocument("test.cs", CreateText("class C1 { void M() { System.Console.WriteLine(0); } }"), filePath: sourceFile.Path);
2555var moduleId = EmitLibrary(project.Id, sourceOnDisk, sourceFilePath: sourceFile.Path);
2734_mockCompilationOutputs.Add(document1.Project.Id, new CompilationOutputFiles(moduleFile.Path, pdbFile.Path));
3544_mockCompilationOutputs.Add(projectA.Id, new CompilationOutputFiles(moduleFileA.Path, pdbFileA.Path));
3545_mockCompilationOutputs.Add(projectB.Id, new CompilationOutputFiles(moduleFileB.Path, pdbFileB.Path));
3678var sourcePath = dir.CreateFile("Lib.cs").WriteAllText(source1, Encoding.UTF8).Path;
3775var sourcePath = dir.CreateFile("Lib.cs").WriteAllText(source1, Encoding.UTF8).Path;
4864var moduleId = EmitLibrary(projectP.Id, source1, sourceFileA.Path, assemblyName: "Proj");
4870loader: new WorkspaceFileTextLoader(solution.Services, sourceFileA.Path, Encoding.UTF8),
4871filePath: sourceFileA.Path));
EditAndContinue\WatchHotReloadServiceTests.cs (7)
66var moduleId = EmitLibrary(projectP.Id, source1, sourceFileA.Path, assemblyName: "Proj");
72loader: new WorkspaceFileTextLoader(solution.Services, sourceFileA.Path, Encoding.UTF8),
73filePath: sourceFileA.Path));
125[$"P: {sourceFileA.Path}: (0,17)-(0,18): Error ENC0110: {string.Format(FeaturesResources.Changing_the_signature_of_0_requires_restarting_the_application_because_it_is_not_supported_by_the_runtime, FeaturesResources.method)}"],
146[$"{sourceFileA.Path}: (0,72)-(0,73): Error CS1002: {CSharpResources.ERR_SemicolonExpected}"],
161$"{sourceFileA.Path}: (0,21)-(0,28): Error CS0103: {string.Format(CSharpResources.ERR_NameNotInContext, "Unknown")}",
162$"{sourceFileA.Path}: (0,51)-(0,52): Warning CS0219: {string.Format(CSharpResources.WRN_UnreferencedVarAssg, "x")}",
Microsoft.CodeAnalysis.LanguageServer.UnitTests (7)
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)
Microsoft.CodeAnalysis.Test.Utilities (15)
Microsoft.CodeAnalysis.UnitTests (106)
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 },
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]);
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);
Microsoft.CodeAnalysis.VisualBasic.CommandLine.UnitTests (237)
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 (194)
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
2378CleanupAllGeneratedFiles(file1.Path)
2379CleanupAllGeneratedFiles(file2.Path)
2380CleanupAllGeneratedFiles(file3.Path)
2381CleanupAllGeneratedFiles(file4.Path)
2382CleanupAllGeneratedFiles(file5.Path)
2442CleanupAllGeneratedFiles(file1.Path)
2443CleanupAllGeneratedFiles(file2.Path)
2444CleanupAllGeneratedFiles(file3.Path)
2445CleanupAllGeneratedFiles(file4.Path)
2446CleanupAllGeneratedFiles(file5.Path)
2447CleanupAllGeneratedFiles(file6.Path)
2593CleanupAllGeneratedFiles(file.Path)
2610CleanupAllGeneratedFiles(file.Path)
2632CleanupAllGeneratedFiles(file.Path)
2656Dim vbc = New MockVisualBasicCompiler(Nothing, dir.Path, {"/nologo", "/t:library", "/a:" + Assembly.GetExecutingAssembly().Location, "a.vb", "/ruleset:" + ruleSetFile.Path})
2666CleanupAllGeneratedFiles(file.Path)
2690"/ruleset:" & ruleSetFile.Path, "/warnaserror", "/nowarn:42376"
2704"/warnaserror+", "/ruleset:" & ruleSetFile.Path, "/nowarn:42376"
2713CleanupAllGeneratedFiles(file.Path)
2740"/ruleset:" & ruleSetFile.Path, "/nowarn"
2755"/nowarn", "/ruleset:" & ruleSetFile.Path
2765CleanupAllGeneratedFiles(file.Path)
2790Dim vbc = New MockVisualBasicCompiler(Nothing, dir.Path, {"/nologo", "/t:library", "/a:" + Assembly.GetExecutingAssembly().Location, "a.vb", "/ruleset:" + ruleSetFile.Path})
2799CleanupAllGeneratedFiles(file.Path)
2823Dim parsedArgs = DefaultParse(New String() {"/ruleset:" + file.Path, "a.cs"}, _baseDirectory)
2825Assert.Equal(expected:=file.Path, actual:=parsedArgs.RuleSetPath)
2848Dim parsedArgs = DefaultParse(New String() {"/ruleset:" + """" + file.Path + """", "a.cs"}, _baseDirectory)
2850Assert.Equal(expected:=file.Path, actual:=parsedArgs.RuleSetPath)
2876parsedArgs = DefaultParse(New String() {"/ruleset:" + file.Path, "a.cs"}, _baseDirectory)
2879Assert.Equal(expected:=file.Path, actual:=parsedArgs.RuleSetPath)
2884Assert.Equal(file.Path, DirectCast(err.Arguments(0), String))
3188AssertEx.Equal(File.ReadAllBytes(sl.Path), blob)
3192CleanupAllGeneratedFiles(src.Path)
3217AssertEx.Equal(File.ReadAllBytes(sl.Path), blob)
3220CleanupAllGeneratedFiles(src.Path)
3353expectedEmbeddedMap.Add(src.Path, embed_vb)
3357expectedEmbeddedMap.Add(src2.Path, embed2_vb)
3361expectedEmbeddedMap.Add(txt.Path, embed_xyz)
3380CleanupAllGeneratedFiles(src.Path)
3612CleanupAllGeneratedFiles(file.Path)
4103CleanupAllGeneratedFiles(src.Path)
4153CleanupAllGeneratedFiles(src.Path)
4154CleanupAllGeneratedFiles(xml.Path)
4234CleanupAllGeneratedFiles(src.Path)
4235CleanupAllGeneratedFiles(xml.Path)
4254CleanupAllGeneratedFiles(src.Path)
4273CleanupAllGeneratedFiles(src.Path)
4292CleanupAllGeneratedFiles(src.Path)
4311CleanupAllGeneratedFiles(src.Path)
4330CleanupAllGeneratedFiles(src.Path)
4349CleanupAllGeneratedFiles(src.Path)
4932Dim binaryPath = Temp.CreateFile().WriteAllBytes(Net461.Resources.mscorlib).Path
5009CleanupAllGeneratedFiles(src.Path)
5026CleanupAllGeneratedFiles(src.Path)
5033Dim filePath = tempFolder.CreateFile("temp.dll").Path
5054CleanupAllGeneratedFiles(src.Path)
5148CleanupAllGeneratedFiles(src.Path)
5180CleanupAllGeneratedFiles(src.Path)
5254File.Delete(sysRuntime.Path)
5260File.Delete(msCorLib.Path)
5262CleanupAllGeneratedFiles(src.Path)
5307File.Delete(msCorLib.Path)
5308CleanupAllGeneratedFiles(src.Path)
5341CleanupAllGeneratedFiles(src.Path)
5364CleanupAllGeneratedFiles(file.Path)
5767CleanupAllGeneratedFiles(file1.Path)
5768CleanupAllGeneratedFiles(file2.Path)
5952CleanupAllGeneratedFiles(file.Path)
6003CleanupAllGeneratedFiles(file.Path)
6042CleanupAllGeneratedFiles(file.Path)
6090CleanupAllGeneratedFiles(file.Path)
6134CleanupAllGeneratedFiles(file.Path)
6182CleanupAllGeneratedFiles(file.Path)
6228CleanupAllGeneratedFiles(file.Path)
6270CleanupAllGeneratedFiles(file.Path)
6274Return result.Value.Replace("PATH", file.Path).Replace("VERSION (HASH)", s_compilerVersion).Replace(vbLf, vbCrLf)
6306CleanupAllGeneratedFiles(file.Path)
6340CleanupAllGeneratedFiles(file.Path)
6374CleanupAllGeneratedFiles(file.Path)
6406CleanupAllGeneratedFiles(file.Path)
6438CleanupAllGeneratedFiles(file.Path)
6486CleanupAllGeneratedFiles(file.Path)
6823Path.GetFileName(sourceFile.Path)
6831String.Format("/win32manifest:{0}", Path.GetFileName(manifestFile.Path)),
6832Path.GetFileName(sourceFile.Path)
6856CleanupAllGeneratedFiles(sourceFile.Path)
6871Dim source As String = folder.CreateFile("src.vb").WriteAllText("").Path
6872Dim ref As String = folder.CreateFile("ref.dll").WriteAllText("").Path
6904</text>.Value).Path
6908</text>.Value).Path
6952</text>.Value).Path
6956</text>.Value).Path
6986</text>.Value).Path
6990</text>.Value).Path
7020</text>.Value).Path
7024</text>.Value).Path
7049</text>.Value).Path
7054</text>.Value).Path
7073</text>.Value).Path
7241</text>.Value).Path
7262</text>.Value).Path
7299</text>.Value).Path
7454</text>.Value).Path
7552CleanupAllGeneratedFiles(src.Path)
7608file.Path & "(4) : error BC30451: 'Goo' is not declared. It may be inaccessible due to its protection level.
7641" & file.Path & "(35) : error BC30451: 'Goo' is not declared. It may be inaccessible due to its protection level.
7649CleanupAllGeneratedFiles(file.Path)
7713CleanupAllGeneratedFiles(file.Path)
7732CleanupAllGeneratedFiles(file.Path)
7921sourceFile.Path
7996CleanupAllGeneratedFiles(file.Path)
8122CleanupAllGeneratedFiles(file.Path)
8277CleanupAllGeneratedFiles(file.Path)
8500CleanupAllGeneratedFiles(file.Path)
8577CleanupAllGeneratedFiles(file.Path)
8639CleanupAllGeneratedFiles(file.Path)
8688CleanupAllGeneratedFiles(src.Path)
8938</text>.Value).Path
8995</text>.Value).Path
9018</text>.Value).Path
9042</text>.Value).Path
9063</text>.Value).Path
9085</text>.Value).Path
9090</text>.Value).Path
9094</text>.Value).Path
9146CleanupAllGeneratedFiles(file.Path)
9560CleanupAllGeneratedFiles(sourceFile.Path)
9666Dim vbcPath = dir.CopyFile(s_basicCompilerExecutable).Path
9726End Class").Path
9732Dim filePath = Temp.CreateFile().WriteAllText("").Path
9789CleanupAllGeneratedFiles(file.Path)
9841CleanupAllGeneratedFiles(file.Path)
9867CleanupAllGeneratedFiles(file.Path)
9933CleanupAllGeneratedFiles(file.Path)
9961CleanupAllGeneratedFiles(file.Path)
10039additionalFlags = additionalFlags.Append("/analyzerconfig:" + analyzerConfig.Path).ToArray()
10096additionalFlags = additionalFlags.Append("/ruleset:" + ruleSetFile.Path).ToArray()
10169Dim args = {"/nologo", "/t:library", "/preferreduilang:en", src.Path}
10209Dim args = {"/warnaserror+", $"/warnaserror-:{diagnosticId}", "/nologo", "/t:library", "/preferreduilang:en", src.Path}
10288additionalFlags = additionalFlags.Append($"/analyzerconfig:{analyzerConfig.Path}").ToArray()
10331Dim globalOption = "/analyzerconfig:" + globalConfig.Path
10332Dim specificOption = "/analyzerconfig:" + analyzerConfig.Path
10362additionalFlags = additionalFlags.Append("/analyzerconfig:" & globalConfig.Path).ToArray()
10394VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference:=False, additionalFlags:={"/warnaserror+", "/analyzerconfig:" + globalConfig.Path})
10416additionalFlags:={"/additionalfile:" & additionalFile.Path},
10491additionalArgs = additionalArgs.Append($"/analyzerconfig:{analyzerConfig.Path}").ToArray()
10563CleanupAllGeneratedFiles(src.Path)
10585CleanupAllGeneratedFiles(src.Path)
10612CleanupAllGeneratedFiles(src.Path)
10628CleanupAllGeneratedFiles(src.Path)
10703CleanupAllGeneratedFiles(src.Path)
10743"/analyzerconfig:" + analyzerConfig.Path,
10744src.Path})
10786"/analyzerconfig:" + analyzerConfig.Path,
10787src.Path})
10831"/analyzerconfig:" + analyzerConfig.Path,
10832src.Path})
10879"/analyzerconfig:" + analyzerConfig.Path,
10880src.Path})
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (13)
Microsoft.CodeAnalysis.VisualBasic.Scripting.UnitTests (2)
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (1)
Microsoft.CodeAnalysis.VisualBasic.Symbol.UnitTests (46)
Microsoft.CodeAnalysis.VisualBasic.Test.Utilities (2)
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (1)
Microsoft.CodeAnalysis.Workspaces.UnitTests (9)
SolutionTests\SolutionTests.cs (8)
1626solution = solution.AddDocument(DocumentInfo.Create(fileDocumentId, "d.cs", loader: new FileTextLoader(fileD.Path, defaultEncoding: null), filePath: fileD.Path));
3327.AddDocument(did, "x", new WorkspaceFileTextLoader(workspace.Services.SolutionServices, file.Path, Encoding.UTF8));
3376.AddDocument(did, "x", new WorkspaceFileTextLoader(workspace.Services.SolutionServices, file.Path, Encoding.UTF8));
3443.AddDocument(did, "x", new WorkspaceFileTextLoader(workspace.Services.SolutionServices, file.Path, Encoding.UTF8));
4548var loader = new TestSmallFileTextLoader(file.Path, Encoding.UTF8);
4550var textLength = FileUtilities.GetFileLength(file.Path);
4552var 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)
Microsoft.VisualStudio.LanguageServices.UnitTests (1)
Roslyn.VisualStudio.Next.UnitTests (11)
Remote\SnapshotSerializationTests.cs (9)
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);
494AssertEx.Equal([file1.Path, file2.Path], recovered.GetProject(project.Id).AnalyzerReferences.Select(r => r.FullPath));
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)));
VBCSCompiler.UnitTests (28)