3 implementations of File
dotnet.Tests (1)
ConfigurerTests\GivenAFirstTimeUseNoticeSentinel.cs (1)
137public IFile File { get; private set; }
Microsoft.DotNet.InternalAbstractions (1)
FileSystemWrapper.cs (1)
10public IFile File { get; } = new FileWrapper();
Microsoft.NET.TestFramework (1)
Mock\FileSystemMockBuilder.cs (1)
328public IFile File { get; }
289 references to File
dotnet (37)
BuildServer\RazorPidFile.cs (1)
27using (var stream = fileSystem.File.OpenFile(
BuildServer\RazorServer.cs (3)
27if (!_fileSystem.File.Exists(PidFile.ServerPath.Value)) 66if (_fileSystem.File.Exists(PidFile.Path.Value)) 68_fileSystem.File.Delete(PidFile.Path.Value);
CommandFactory\CommandResolution\LocalToolsCommandResolver.cs (1)
89if (!_fileSystem.File.Exists(toolCommand.Executable.Value))
Commands\Tool\Restore\ToolPackageRestorer.cs (1)
129&& _fileSystem.File.Exists(toolCommand.Executable.Value);
PerformanceLogEventListener.cs (1)
76Stream outputStream = fileSystem.File.OpenFile(
ShellShim\ShellShimRepository.cs (7)
53_fileSystem.File.Copy(packagedShim.Value.Value, GetShimPath(toolCommand).Value); 109foreach (var file in GetShimFiles(toolCommand).Where(f => _fileSystem.File.Exists(f.Value))) 124foreach (var file in GetShimFiles(toolCommand).Where(f => _fileSystem.File.Exists(f.Value))) 127FileAccessRetrier.RetryOnMoveAccessFailure(() => _fileSystem.File.Move(file.Value, tempPath)); 146_fileSystem.File.Delete(value); 153FileAccessRetrier.RetryOnMoveAccessFailure(() => _fileSystem.File.Move(kvp.Value, kvp.Key)); 170return GetShimFiles(toolCommand).Any(p => _fileSystem.File.Exists(p.Value));
ToolManifest\ToolManifestEditor.cs (5)
53_fileSystem.File.WriteAllText(manifest.Value, deserializedManifest.ToJson()); 76_fileSystem.File.WriteAllText(manifest.Value, deserializedManifest.ToJson()); 109_fileSystem.File.WriteAllText(manifest.Value, deserializedManifest.ToJson()); 138using (Stream jsonStream = _fileSystem.File.OpenRead(possibleManifest.Value)) 430_fileSystem.File.WriteAllText(
ToolManifest\ToolManifestFinder.cs (7)
72if (!_fileSystem.File.Exists(possibleManifest.Value)) 106if (!_fileSystem.File.Exists(possibleManifest.Value)) 138if (!_fileSystem.File.Exists(possibleManifest.Value)) 197if (_fileSystem.File.Exists(possibleManifest.Value)) 233|| _fileSystem.File.Exists(currentSearchDirectory.Value.WithFile(".git").Value)) 254_fileSystem.File.WriteAllText(manifestFileLocation, manifestFileContent); 279if (_fileSystem.File.Exists(possibleManifest.Value))
ToolPackage\LocalToolsResolverCache.cs (5)
40if (_fileSystem.File.Exists(packageCacheFile)) 50_fileSystem.File.WriteAllText( 63_fileSystem.File.WriteAllText( 75if (_fileSystem.File.Exists(packageCacheFile)) 97JsonSerializer.Deserialize<CacheRow[]>(_fileSystem.File.ReadAllText(packageCacheFile));
ToolPackage\ToolConfigurationDeserializer.cs (1)
30using (var stream = fileSystem.File.OpenRead(pathToXml))
ToolPackage\ToolPackageDownloaderBase.cs (3)
383if (_fileSystem.File.Exists(runtimeConfigFilePath)) 385string existingJson = _fileSystem.File.ReadAllText(runtimeConfigFilePath); 392_fileSystem.File.WriteAllText(runtimeConfigFilePath, updateJson);
ToolPackage\ToolPackageInstance.cs (2)
55bool usingRidSpecificPackage = _fileSystem.File.Exists(assetsJsonParentDirectory.WithFile(RidSpecificPackageAssetsFileName).Value); 71using (var stream = _fileSystem.File.OpenRead(resolvedAssetsFileNameFullPath))
dotnet.Tests (173)
BuildServerTests\BuildServerProviderTests.cs (1)
165fileSystemMock.SetupGet(fs => fs.File).Returns(fileMock.Object);
BuildServerTests\RazorServerTests.cs (9)
37fileSystemMock.File.Exists(pidFilePath).Should().BeTrue(); 38fileSystemMock.File.Exists(serverPath).Should().BeTrue(); 56fileSystemMock.File.Exists(pidFilePath).Should().BeTrue(); 76fileSystemMock.File.Exists(pidFilePath).Should().BeTrue(); 77fileSystemMock.File.Exists(serverPath).Should().BeTrue(); 90fileSystemMock.File.Exists(pidFilePath).Should().BeFalse(); 109fileSystemMock.File.Exists(pidFilePath).Should().BeTrue(); 110fileSystemMock.File.Exists(serverPath).Should().BeFalse(); 127fileSystemMock.File.Exists(pidFilePath).Should().BeFalse();
CommandFactoryTests\GivenALocalToolsCommandResolver.cs (11)
48_fileSystem.File.Exists(commandPath).Should().BeTrue("the following path exists: " + commandPath); 67_fileSystem.File.Exists(commandPath).Should().BeTrue("the following path exists: " + commandPath); 87_fileSystem.File.WriteAllText(Path.Combine(_testDirectoryRoot, ManifestFilename), 94_fileSystem.File.CreateEmptyFile(fakeExecutable.Value); 120_fileSystem.File.WriteAllText(Path.Combine(_testDirectoryRoot, ManifestFilename), 127_fileSystem.File.CreateEmptyFile(fakeExecutable.Value); 145_fileSystem.File.Delete(fakeExecutable.Value); 161_fileSystem.File.WriteAllText(Path.Combine(_testDirectoryRoot, ManifestFilename), 183_fileSystem.File.WriteAllText(Path.Combine(_testDirectoryRoot, ManifestFilename), 191_fileSystem.File.CreateEmptyFile(fakeExecutableA.Value); 192_fileSystem.File.CreateEmptyFile(fakeExecutableDotnetA.Value);
CommandTests\Tool\Install\ToolInstallGlobalOrToolPathCommandTests.cs (11)
98_fileSystem.File.WriteAllText(Path.Combine(_temporaryDirectory, "nuget.config"), _nugetConfigWithInvalidSources); 109_fileSystem.File.Delete(Path.Combine(_temporaryDirectory, "nuget.config")); 149_fileSystem.File.Exists(ExpectedCommandPath()).Should().BeTrue(); 151_fileSystem.File.ReadAllText(ExpectedCommandPath())); 153_fileSystem.File.Exists(deserializedFakeShim.ExecutablePath).Should().BeTrue(); 173_fileSystem.File.Exists(ExpectedCommandPath()).Should().BeTrue(); 214_fileSystem.File.Exists(ExpectedCommandPath()) 218_fileSystem.File.ReadAllText(ExpectedCommandPath())); 219_fileSystem.File.Exists(deserializedFakeShim.ExecutablePath).Should().BeTrue(); 289_fileSystem.File.CreateEmptyFile(ExpectedCommandPath()); // Create conflict shim 891_fileSystem.File.ReadAllText(ExpectedCommandPath()).Should().Be(tokenToIdentifyPackagedShim);
CommandTests\Tool\Install\ToolInstallLocalCommandTests.cs (25)
82_fileSystem.File.WriteAllText(Path.Combine(_temporaryDirectory, _manifestFilePath), _jsonContent); 105_fileSystem.File.WriteAllText(Path.Combine(_temporaryDirectory, "nuget.config"), _nugetConfigWithInvalidSources); 117_fileSystem.File.Delete(Path.Combine(_temporaryDirectory, "nuget.config")); 133_fileSystem.File.Delete(_manifestFilePath); 153_fileSystem.File.Delete(_manifestFilePath); 178_fileSystem.File.Delete(_manifestFilePath); 180_fileSystem.File.WriteAllText(explicitManifestFilePath, _jsonContent); 216_fileSystem.File.ReadAllText(_manifestFilePath).Should() 237_fileSystem.File.ReadAllText(_manifestFilePath).Should() 289_fileSystem.File.ReadAllText(_manifestFilePath).Should() 322_fileSystem.File.Delete(_manifestFilePath); 326_fileSystem.File.WriteAllText(configManifestPath, _jsonContent); 338_fileSystem.File.Exists(configManifestPath).Should().BeTrue("The .config manifest file should exist"); 339var configManifestContent = _fileSystem.File.ReadAllText(configManifestPath); 344_fileSystem.File.Exists(_manifestFilePath).Should().BeFalse("No manifest should exist in the root folder"); 425_fileSystem.File.Exists(restoredCommand.Executable.Value); 432_fileSystem.File.Delete(_manifestFilePath); 450_fileSystem.File.Exists(Path.Combine(_temporaryDirectory, "dotnet-tools.json")).Should().BeTrue(); 456_fileSystem.File.Delete(_manifestFilePath); 472_fileSystem.File.Exists(Path.Combine(_temporaryDirectory, "dotnet-tools.json")).Should().BeTrue(); 479_fileSystem.File.Delete(_manifestFilePath); 497_fileSystem.File.Exists(Path.Combine(_temporaryDirectory, "dotnet-tools.json")).Should().BeTrue(); 503_fileSystem.File.Delete(_manifestFilePath); 519_fileSystem.File.Exists(Path.Combine(_temporaryDirectory, "dotnet-tools.json")).Should().BeTrue(); 570_fileSystem.File.Exists(restoredCommand.Executable.Value);
CommandTests\Tool\Restore\ToolRestoreCommandTests.cs (1)
146_fileSystem.File.Exists(restoredCommand.Executable.Value)
CommandTests\Tool\Restore\ToolRestoreCommandWithMultipleNugetConfigTests.cs (2)
68_fileSystem.File.CreateEmptyFile(_nugetConfigUnderTestRoot); 72_fileSystem.File.CreateEmptyFile(_nugetConfigUnderSubDir);
CommandTests\Tool\Uninstall\ToolUninstallGlobalOrToolPathCommandTests.cs (6)
80_fileSystem.File.Exists(shimPath).Should().BeTrue(); 96_fileSystem.File.Exists(shimPath).Should().BeFalse(); 122_fileSystem.File.Exists(shimPath).Should().BeTrue(); 166_fileSystem.File.Exists(shimPath).Should().BeFalse(); 192_fileSystem.File.Exists(shimPath).Should().BeTrue(); 209_fileSystem.File.Exists(shimPath).Should().BeTrue();
CommandTests\Tool\Uninstall\ToolUninstallLocalCommandTests.cs (15)
40_fileSystem.File.WriteAllText(Path.Combine(_temporaryDirectory, _manifestFilePath), _jsonContent); 57_fileSystem.File.ReadAllText(_manifestFilePath).Should().Be(_entryRemovedJsonContent); 63_fileSystem.File.Delete(_manifestFilePath); 78_fileSystem.File.Delete(_manifestFilePath); 79_fileSystem.File.WriteAllText(_manifestFilePath, _jsonContentContainNoPackageId); 92_fileSystem.File.Delete(_manifestFilePath); 94_fileSystem.File.WriteAllText(explicitManifestFilePath, _jsonContent); 106_fileSystem.File.ReadAllText(explicitManifestFilePath).Should().Be(_entryRemovedJsonContent); 124_fileSystem.File.ReadAllText(_manifestFilePath).Should().Be(_entryRemovedJsonContent); 143_fileSystem.File.WriteAllText(parentManifestFilePath, _jsonContent); 147_fileSystem.File.ReadAllText(_manifestFilePath).Should().Be(_entryRemovedJsonContent, "Change the closest one"); 148_fileSystem.File.ReadAllText(parentManifestFilePath).Should().Be(_jsonContent, "Do not change the manifest layer above"); 155_fileSystem.File.WriteAllText(parentManifestFilePath, _jsonContent); 160_fileSystem.File.ReadAllText(parentManifestFilePath).Should().Be( 169_fileSystem.File.WriteAllText(parentManifestFilePath, _jsonContent);
CommandTests\Tool\Update\ToolUpdateGlobalOrToolPathCommandTests.cs (3)
117_fileSystem.File.WriteAllText(Path.Combine(_tempDirectory, "nuget.config"), _nugetConfigWithInvalidSources); 122_fileSystem.File.Delete(Path.Combine(_tempDirectory, "nuget.config")); 438_fileSystem.File.ReadAllText(ExpectedCommandPath()).Should().Be(tokenToIdentifyPackagedShim);
CommandTests\Tool\Update\ToolUpdateLocalCommandTests.cs (12)
102_fileSystem.File.WriteAllText(Path.Combine(_temporaryDirectory, _manifestFilePath), _jsonContent); 147_fileSystem.File.WriteAllText(Path.Combine(_temporaryDirectory, "nuget.config"), _nugetConfigWithInvalidSources); 159_fileSystem.File.Delete(Path.Combine(_temporaryDirectory, "nuget.config")); 226_fileSystem.File.Delete(_manifestFilePath); 227_fileSystem.File.WriteAllText(Path.Combine(_temporaryDirectory, _manifestFilePath), _jsonEmptyContent); 237_fileSystem.File.Delete(_manifestFilePath); 248_fileSystem.File.Delete(_manifestFilePath); 250_fileSystem.File.WriteAllText(explicitManifestFilePath, _jsonContent); 316_fileSystem.File.WriteAllText(parentManifestFilePath, _jsonContent); 326_fileSystem.File.ReadAllText(parentManifestFilePath).Should().Be(_jsonContent, "no change"); 333_fileSystem.File.WriteAllText(parentManifestFilePath, _jsonContent); 425_fileSystem.File.Exists(restoredCommand.Executable.Value).Should().BeTrue();
ConfigurerTests\GivenAFirstTimeUseNoticeSentinel.cs (3)
91fileSystemMock.File.ReadAllText(sentinel).Should().Be(contentToValidateSentinelWasNotReplaced); 103fileSystemMock.File, 121fileSystemMock.File,
ConfigurerTests\GivenAFunctionReturnStringAndFakeFileSystem.cs (5)
26_fileSystemMock.File, 56_fileSystemMock.File.Exists(path); 57_fileSystemMock.File.ReadAllText(path).Should().Be("foo"); 65_fileSystemMock.File.Exists(cacheFilePath); 66_fileSystemMock.File.ReadAllText(cacheFilePath).Should().Be("foo");
ShellShimTests\LinuxEnvironmentPathTests.cs (6)
32FileSystemMockBuilder.Empty.File); 61.File); 86FileSystemMockBuilder.Empty.File); 100var fileSystem = new FileSystemMockBuilder().Build().File; 140fileSystem.File); 147.File
ShellShimTests\OsxEnvironmentPathTests.cs (6)
32FileSystemMockBuilder.Empty.File); 61.File); 86FileSystemMockBuilder.Empty.File); 100var fileSystem = new FileSystemMockBuilder().Build().File; 140fileSystem.File); 147.File
ToolManifestTests\ToolManifestEditorTests.cs (20)
30_fileSystem.File.WriteAllText(manifestFile, _jsonContent); 39_fileSystem.File.ReadAllText(manifestFile).Should().Be( 73_fileSystem.File.WriteAllText(manifestFile, _jsonContentWithoutToolsEntry); 82_fileSystem.File.ReadAllText(manifestFile).Should().Be( 101_fileSystem.File.WriteAllText(manifestFile, _jsonContent); 122_fileSystem.File.ReadAllText(manifestFile).Should().Be(_jsonContent); 129_fileSystem.File.WriteAllText(manifestFile, _jsonContent); 142_fileSystem.File.ReadAllText(manifestFile).Should().Be(_jsonContent); 149_fileSystem.File.WriteAllText(manifestFile, _jsonWithInvalidField); 166_fileSystem.File.ReadAllText(manifestFile).Should().Be(_jsonWithInvalidField); 173_fileSystem.File.WriteAllText(manifestFile, _jsonContentMissingVersion); 187_fileSystem.File.WriteAllText(manifestFile, _jsonContent); 194_fileSystem.File.ReadAllText(manifestFile).Should().Be( 214_fileSystem.File.WriteAllText(manifestFile, _jsonContent); 226_fileSystem.File.ReadAllText(manifestFile).Should().Be(_jsonContent); 233_fileSystem.File.WriteAllText(manifestFile, _jsonWithInvalidField); 247_fileSystem.File.ReadAllText(manifestFile).Should().Be(_jsonWithInvalidField); 254_fileSystem.File.WriteAllText(manifestFile, _jsonContent); 272_fileSystem.File.WriteAllText(manifestFile, _jsonContent); 281_fileSystem.File.ReadAllText(manifestFile).Should().Be(
ToolManifestTests\ToolManifestFinderTests.cs (37)
48_fileSystem.File.WriteAllText(Path.Combine(_testDirectoryRoot, _manifestFilename), _jsonContent); 64_fileSystem.File.WriteAllText(Path.Combine(_testDirectoryRoot, _manifestFilename), _jsonContent); 81_fileSystem.File.WriteAllText(Path.Combine(dotnetconfigDirectory, _manifestFilename), _jsonContent); 103_fileSystem.File.WriteAllText(Path.Combine(dotnetconfigDirectory, _manifestFilename), _jsonContent); 141_fileSystem.File.WriteAllText(Path.Combine(dotnetconfigDirectory, _manifestFilename), _jsonContent); 164_fileSystem.File.WriteAllText(Path.Combine(dotnetconfigDirectory, _manifestFilename), _jsonContent); 203_fileSystem.File.WriteAllText(Path.Combine(_testDirectoryRoot, _manifestFilename), 222_fileSystem.File.WriteAllText(Path.Combine(_testDirectoryRoot, customFileName), _jsonContent); 279_fileSystem.File.WriteAllText(Path.Combine(_testDirectoryRoot, _manifestFilename), _jsonWithMissingField); 299_fileSystem.File.WriteAllText(Path.Combine(_testDirectoryRoot, _manifestFilename), _jsonWithInvalidField); 315_fileSystem.File.WriteAllText( 332_fileSystem.File.WriteAllText( 350_fileSystem.File.WriteAllText(Path.Combine(_testDirectoryRoot, _manifestFilename), 352_fileSystem.File.WriteAllText(Path.Combine(subdirectoryOfTestRoot, _manifestFilename), 395_fileSystem.File.WriteAllText(manifestFileInParentDirectory, 398_fileSystem.File.WriteAllText(manifestFileInSubDirectory, 448_fileSystem.File.WriteAllText(Path.Combine(_testDirectoryRoot, _manifestFilename), 450_fileSystem.File.WriteAllText(Path.Combine(subdirectoryOfTestRoot, _manifestFilename), 466_fileSystem.File.WriteAllText(Path.Combine(_testDirectoryRoot, _manifestFilename), _jsonContentHigherVersion); 483_fileSystem.File.WriteAllText(Path.Combine(_testDirectoryRoot, _manifestFilename), _jsonContentIsRootMissing); 498_fileSystem.File.WriteAllText(Path.Combine(_testDirectoryRoot, _manifestFilename), _jsonContent); 518_fileSystem.File.WriteAllText(Path.Combine(_testDirectoryRoot, _manifestFilename), _jsonContent); 539_fileSystem.File.WriteAllText(Path.Combine(_testDirectoryRoot, _manifestFilename), _jsonContent); 571_fileSystem.File.WriteAllText(Path.Combine(_testDirectoryRoot, _manifestFilename), _jsonWithMissingField); 585_fileSystem.File.WriteAllText(Path.Combine(_testDirectoryRoot, _manifestFilename), _jsonWithInvalidField); 599_fileSystem.File.WriteAllText(Path.Combine(_testDirectoryRoot, _manifestFilename), _jsonContentInvalidJson); 615_fileSystem.File.WriteAllText(Path.Combine(_testDirectoryRoot, _manifestFilename), 617_fileSystem.File.WriteAllText(Path.Combine(subdirectoryOfTestRoot, _manifestFilename), 640_fileSystem.File.WriteAllText(Path.Combine(_testDirectoryRoot, _manifestFilename), 642_fileSystem.File.WriteAllText(Path.Combine(subdirectoryOfTestRoot, _manifestFilename), 659_fileSystem.File.WriteAllText(manifestFilePath, _jsonContent); 676_fileSystem.File.WriteAllText(Path.Combine(_testDirectoryRoot, _manifestFilename), 693_fileSystem.File.WriteAllText(manifestPath, _jsonContent); 709_fileSystem.File.WriteAllText(manifestPath, _jsonWithMissingField); 741_fileSystem.File.WriteAllText(Path.Combine(_testDirectoryRoot, _manifestFilename), 743_fileSystem.File.WriteAllText(Path.Combine(subdirectoryOfTestRoot, _manifestFilename), 779_fileSystem.File.Exists(Path.Combine(_testDirectoryRoot, "dotnet-tools.json")).Should().BeTrue();
Microsoft.DotNet.Cli.Utils.Tests (52)
MockFileSystemTests.cs (52)
19fileSystem.File.CreateEmptyFile(nestedFilePath); 33fileSystem.File.CreateEmptyFile(nestedFilePath); 35fileSystem.File.Exists($"{directory}/filename").Should().BeTrue(); 47fileSystem.File.CreateEmptyFile(nestedFilePath); 49fileSystem.File.Exists(nestedFilePath).Should().BeTrue(); 61Action a = () => fileSystem.File.CreateEmptyFile(nestedFilePath); 75fileSystem.File.CreateEmptyFile("file"); 77fileSystem.File.Exists(Path.Combine(directory, "file")).Should().BeTrue(); 128fileSystem.File.CreateEmptyFile(path); 142Action a = () => fileSystem.File.CreateEmptyFile(nestedFilePath); 155fileSystem.File.WriteAllText(path, content); 157fileSystem.File.ReadAllText(path).Should().Be(content); 169Action a = () => fileSystem.File.ReadAllText(path); 184Action a = () => fileSystem.File.ReadAllText(directory); 197fileSystem.File.WriteAllText(path, content); 200using (Stream fs = fileSystem.File.OpenRead(path)) 222fileSystem.File.CreateEmptyFile(sourceFile); 225fileSystem.File.Move(sourceFile, destinationFile); 227fileSystem.File.Exists(sourceFile).Should().BeFalse(); 228fileSystem.File.Exists(destinationFile).Should().BeTrue(); 242Action a = () => fileSystem.File.Move(sourceFile, destinationFile); 259Action a = () => fileSystem.File.Move(badSourceFile, destinationFile); 272fileSystem.File.CreateEmptyFile(sourceFile); 276Action a = () => fileSystem.File.Move(sourceFile, destinationFile); 290fileSystem.File.WriteAllText(sourceFile, "content"); 293fileSystem.File.Copy(sourceFile, destinationFile); 295fileSystem.File.ReadAllText(sourceFile).Should().Be(fileSystem.File.ReadAllText(destinationFile)); 308Action a = () => fileSystem.File.Copy(sourceFile, destinationFile); 324Action a = () => fileSystem.File.Copy(badSourceFile, destinationFile); 337fileSystem.File.CreateEmptyFile(sourceFile); 340Action a = () => fileSystem.File.Copy(sourceFile, destinationFile); 354fileSystem.File.CreateEmptyFile(sourceFile); 356fileSystem.File.CreateEmptyFile(destinationFile); 358Action a = () => fileSystem.File.Copy(sourceFile, destinationFile); 372fileSystem.File.CreateEmptyFile(file); 374fileSystem.File.Delete(file); 376fileSystem.File.Exists(file).Should().BeFalse(); 388Action a = () => fileSystem.File.Delete(file); 405Action a = () => fileSystem.File.Delete(file); 433fileSystem.File.CreateEmptyFile(wrongFilePath); 468fileSystem.File.CreateEmptyFile(file1); 469fileSystem.File.CreateEmptyFile(file2); 499fileSystem.File.CreateEmptyFile(wrongFilePath); 535fileSystem.File.CreateEmptyFile(file1); 536fileSystem.File.CreateEmptyFile(file2); 586fileSystem.File.CreateEmptyFile(actuallyAFilePath); 602fileSystem.File.CreateEmptyFile(testDirectoryFilePath); 621fileSystem.File.CreateEmptyFile(testDirectoryFilePath); 639fileSystem.File.CreateEmptyFile(testDirectoryFilePath); 647fileSystem.File.Exists(Path.Combine(testDestinationDirectoryPath, nestedFilePath)).Should().BeTrue(); 694fileSystem.File.CreateEmptyFile(testDestinationDirectoryPath);
Microsoft.DotNet.Configurer (6)
AspNetCertificateSentinel.cs (1)
33return _fileSystem.File.Exists(SentinelPath);
FileSentinel.cs (1)
26return _fileSystem.File.Exists(_file.Value);
FirstTimeUseNoticeSentinel.cs (1)
33return _fileSystem.File.Exists(SentinelPath);
IFileExtensions.cs (2)
18if (!fileSystem.File.Exists(filePath)) 25fileSystem.File.CreateEmptyFile(filePath);
UserLevelCacheWriter.cs (1)
18FileSystemWrapper.Default.File,
Microsoft.DotNet.PackageInstall.Tests (10)
LocalToolsResolverCacheTests.cs (4)
206fileSystem.File.WriteAllText(cachePath, existingCache + " !!!Corrupted") 255fileSystem.File.ReadAllText( 259fileSystem.File.WriteAllText(cachePath, existingCache + " !!!Corrupted"); 312fileSystem.File.ReadAllText(
NuGetPackageInstallerTests.cs (1)
361fileSystem.File.WriteAllText(filePath.Value.Value, FormatNuGetConfig(
ToolPackageDownloaderTests.cs (4)
126fileSystem.File.Exists(assetJsonPath).Should().BeTrue(); 815fileSystem.File.Exists(package.Command.Executable.Value).Should().BeTrue($"{package.Command.Executable.Value} should exist"); 845fileSystem.File.Exists(package.Command.Executable.Value).Should() 931fileSystem.File.WriteAllText(filePath.Value.Value, FormatNuGetConfig(
ToolPackageInstallerNugetCacheTests.cs (1)
54fileSystem.File
Microsoft.DotNet.Tools.Tests.ComponentMocks (11)
AppHostShellShimMakerMock.cs (1)
29_fileSystem.File.WriteAllText(
ToolPackageDownloaderMock.cs (5)
145_fileSystem.File.CreateEmptyFile(Path.Combine(_toolDownloadDir.Value, fakeExecutablePath)); 146_fileSystem.File.WriteAllText( 149_fileSystem.File.WriteAllText( 174_fileSystem.File.CreateEmptyFile(executable.Value); 280_fileSystem.File.Exists(possibleNugetConfig.Value));
ToolPackageDownloaderMock2.cs (4)
94_fileSystem.File.WriteAllText(assetFilePath, assetFileContents); 140_fileSystem.File.CreateEmptyFile(fakeExecutablePath); 141_fileSystem.File.WriteAllText(Path.Combine(fakeExecutableSubDirectory, "DotnetToolSettings.xml"), 157_fileSystem.File.WriteAllText(resolvedPath, additionalFile.Value);
ToolPackageMock.cs (1)
77var executablePath = _fileSystem.File.ReadAllText(Path.Combine(PackageDirectory.Value, "project.assets.json"));