public void CopySuccess( string dependencyName, string dependencyVersion, string dependencyExtension, string descriptorPath, string descriptorName, int index) { // Compute dependency path string dependencyFilePath = FileSystem.ComputeDependencyFilePath(dependencyName, dependencyVersion, dependencyExtension); string fileName = FileSystem.ComputeFileName(dependencyName, dependencyVersion, dependencyExtension); string descriptorLocation = Path.Combine("Ressources", descriptorPath, descriptorName); string copiedDependencyLocation = Path.Combine("Ressources", descriptorPath, "dependency"); // Remove the dependency path if it exists if (Directory.Exists(copiedDependencyLocation)) { Directory.Delete(copiedDependencyLocation, true); } // Trigger install ExecutionResult install1result = new InstallTask(string.Format(CultureInfo.InvariantCulture, "{0}.{1}", Path.Combine("Ressources", "Assembly", "UTSampleWithPdb"), "dll")).ExecuteAsync().Result; ExecutionResult install2result = new InstallTask(string.Format(CultureInfo.InvariantCulture, "{0}.{1}", Path.Combine("Ressources", "Assembly", "UTSample"), "dll")).ExecuteAsync().Result; // Trigger copy ExecutionResult resultCopy = new CopyTask(descriptorLocation).ExecuteAsync().Result; Assert.AreEqual(ExecutionResultStatus.Success, resultCopy.Status); // Assert output List<ExecutionResult> executionResults = resultCopy.BlockingSubExecutionResults.ToList(); Assert.AreEqual(true, Directory.Exists(copiedDependencyLocation)); Assert.AreEqual(true, File.Exists(Path.Combine(copiedDependencyLocation, fileName))); Assert.AreEqual(ExecutionResultStatus.Success, executionResults[index].Status); Assert.AreEqual(true, executionResults[index].Message.StartsWith("Restored dependency")); }
public void CopyError(string fileName) { ExecutionResult result = new CopyTask(fileName).ExecuteAsync().Result; Assert.AreEqual(ExecutionResultStatus.Error, result.Status); }