internal FakeFileSystem([NotNull] DirectoryEntry root, [NotNull] WaitIndicator copyWaitIndicator) { Guard.NotNull(root, nameof(root)); this.root = root; File = new FileOperationLocker <FakeFile>(this, new FakeFile(root, this)); Directory = new DirectoryOperationLocker <FakeDirectory>(this, new FakeDirectory(root, this)); CurrentDirectoryManager = new CurrentDirectoryManager(root); relativePathConverter = new RelativePathConverter(CurrentDirectoryManager); CopyWaitIndicator = copyWaitIndicator; }
internal FakeFileSystem([NotNull] VolumeContainer container, [NotNull] string tempDirectory, [NotNull] WaitIndicator copyWaitIndicator) { Guard.NotNull(container, nameof(container)); Guard.NotNull(copyWaitIndicator, nameof(copyWaitIndicator)); this.container = container; TempDirectory = tempDirectory; CopyWaitIndicator = copyWaitIndicator; File = new FileOperationLocker <FakeFile>(container.FileSystemLock, new FakeFile(container, this)); Directory = new DirectoryOperationLocker <FakeDirectory>(container.FileSystemLock, new FakeDirectory(container, this)); Drive = new DriveOperationLocker <FakeDrive>(container.FileSystemLock, new FakeDrive(container, this)); Path = new PathOperationLocker <FakePath>(container.FileSystemLock, new FakePath(container, this)); CurrentDirectoryManager = new CurrentDirectoryManager(container); relativePathConverter = new RelativePathConverter(CurrentDirectoryManager); RandomNumberGenerator = CreateRandomNumberGenerator(container.SystemClock); }
private void WaitOnIndicator([NotNull] WaitIndicator indicator) { indicator.SetStarted(); indicator.WaitForComplete(); }