internal TestAssetInfo(DirectoryInfo root, string assetName) { if (!root.Exists) { throw new DirectoryNotFoundException($"Directory not found at '{root}'"); } _assetName = assetName; _root = root; _dataDirectory = new DirectoryInfo(Path.Combine(_root.FullName, DataDirectoryName)); _inventoryFiles = new TestAssetInventoryFiles(_dataDirectory); _directoriesToExclude = new [] { _dataDirectory }; if (!_dataDirectory.Exists) { _dataDirectory.Create(); } }
internal TestAssetInfo(DirectoryInfo root, string assetName, FileInfo dotnetExeFile, string projectFilePattern) { if (root == null) { throw new ArgumentNullException(nameof(root)); } if (string.IsNullOrWhiteSpace(assetName)) { throw new ArgumentException("Argument cannot be null or whitespace", nameof(assetName)); } if (dotnetExeFile == null) { throw new ArgumentNullException(nameof(dotnetExeFile)); } if (string.IsNullOrWhiteSpace(projectFilePattern)) { throw new ArgumentException("Argument cannot be null or whitespace", nameof(projectFilePattern)); } _root = root; _assetName = assetName; _dotnetExeFile = dotnetExeFile; _projectFilePattern = projectFilePattern; _dataDirectory = _root.GetDirectory(DataDirectoryName); _inventoryFiles = new TestAssetInventoryFiles(_dataDirectory); _directoriesToExclude = new [] { _dataDirectory }; }