35 instantiations of FileState
Microsoft.Build.Tasks.Core (4)
Copy.cs (4)
485if (DoCopyIfNecessary(new FileState(SourceFiles[i].ItemSpec), new FileState(DestinationFiles[i].ItemSpec), copyFile)) 591new FileState(sourceItem.ItemSpec), 592new FileState(destItem.ItemSpec),
Microsoft.Build.Tasks.UnitTests (31)
FileStateTests.cs (31)
25new FileState(""); 31new FileState("|"); 37new FileState(new String('x', 5000)); 43var state = new FileState("|"); 52delegate () { var x = new FileState(new String('x', 5000)).LastWriteTime; }); 64FileState state = new FileState(file); 83FileState state = new FileState(file); 96var state = new FileState(Path.GetTempPath()); 110FileState state = new FileState(file); 129FileState state = new FileState(file); 148FileState state = new FileState(file); 167FileState state = new FileState(file); 186FileState state = new FileState(file); 212FileState state = new FileState(file); 238FileState state = new FileState(file); 264FileState state = new FileState(file); 292FileState state = new FileState(file); 317FileState state = new FileState(file); 334Assert.Equal(new FileInfo(Path.GetTempPath()).Exists, new FileState(Path.GetTempPath()).FileExists); 335Assert.True(new FileState(Path.GetTempPath()).IsDirectory); 341Assert.Equal(new FileInfo(Path.GetTempPath()).IsReadOnly, new FileState(Path.GetTempPath()).IsReadOnly); 347Assert.Equal(new FileInfo(Path.GetTempPath()).LastWriteTime, new FileState(Path.GetTempPath()).LastWriteTime); 353Assert.Equal(new FileInfo(Path.GetTempPath()).LastWriteTimeUtc, new FileState(Path.GetTempPath()).LastWriteTimeUtcFast); 359Helpers.VerifyAssertThrowsSameWay(delegate () { var x = new FileInfo(Path.GetTempPath()).Length; }, delegate () { var x = new FileState(Path.GetTempPath()).Length; }); 369Assert.Equal(new FileInfo(file).LastWriteTime, new FileState(file).LastWriteTime); 379Assert.Equal(new FileInfo(file).LastWriteTimeUtc, new FileState(file).LastWriteTimeUtcFast); 387Helpers.VerifyAssertThrowsSameWay(delegate () { var x = new FileInfo(file).Length; }, delegate () { var x = new FileState(file).Length; }); 397var x = new FileState(file).IsDirectory; 405Assert.Equal(Directory.Exists(file), new FileState(file).DirectoryExists); 413Assert.False(new FileState(file).FileExists); 414Assert.False(new FileState(file).DirectoryExists);
47 references to FileState
Microsoft.Build.Tasks.Core (15)
Copy.cs (13)
178FileState sourceFile, 179FileState destinationFile) 230FileState sourceFileState, 231FileState destinationFileState) 365private void TryCopyViaLink(string linkComment, MessageImportance messageImportance, FileState sourceFileState, FileState destinationFileState, out bool linkCreated, ref string errorMessage, Func<string, string, string, bool> createLink) 377private void MakeFileWriteable(FileState file, bool logActivity) 837private bool DoCopyIfNecessary(FileState sourceFileState, FileState destinationFileState, CopyFileWithState copyFile) 897private bool DoCopyWithRetries(FileState sourceFileState, FileState destinationFileState, CopyFileWithState copyFile) 1036private static bool PathsAreIdentical(FileState source, FileState destination)
FileState.cs (2)
20internal delegate bool? CopyFileWithState(FileState source, FileState destination);
Microsoft.Build.Tasks.UnitTests (32)
Copy_Tests.cs (18)
1999var filesActuallyCopied = new List<KeyValuePair<FileState, FileState>>(); 2011bool success = t.Execute(delegate (FileState source, FileState dest) 2015filesActuallyCopied.Add(new KeyValuePair<FileState, FileState>(source, dest)); 2066var filesActuallyCopied = new List<KeyValuePair<FileState, FileState>>(); 2078bool success = t.Execute(delegate (FileState source, FileState dest) 2082filesActuallyCopied.Add(new KeyValuePair<FileState, FileState>(source, dest)); 3014internal bool? CopyFile(FileState source, FileState destination) 3051internal List<FileState> FilesCopiedSuccessfully { get; } = new List<FileState>(); 3065internal bool? Copy(FileState source, FileState destination)
FileStateTests.cs (14)
43var state = new FileState("|"); 64FileState state = new FileState(file); 83FileState state = new FileState(file); 96var state = new FileState(Path.GetTempPath()); 110FileState state = new FileState(file); 129FileState state = new FileState(file); 148FileState state = new FileState(file); 167FileState state = new FileState(file); 186FileState state = new FileState(file); 212FileState state = new FileState(file); 238FileState state = new FileState(file); 264FileState state = new FileState(file); 292FileState state = new FileState(file); 317FileState state = new FileState(file);