public string GetTempPath() { string path = Path.Combine(FileSystemHelper.BuildCurrentPath(), "temp", Guid.NewGuid().ToString("N")); Directory.CreateDirectory(path); return(path); }
private async Task ExecuteTestAsync(string[] args, CancellationToken ct) { var command = new ProcessPathCommand() { AmountPerAxis = 10, DesiredSize = 250, SourcePath = Path.Combine(FileSystemHelper.BuildCurrentPath(), "data", "SMIR.Brain.XX.O.MR_Flair.36620.mha"), DestinationPath = Path.Combine(FileSystemHelper.BuildCurrentPath(), "temp", Guid.NewGuid().ToString("N")) }; command.AxisTypes.Add(AxisType.Z); await ExecuteCommandAsync(command, ct, true); }
public void FileSystemExtensions_BuildAbsolutePath_1(string path) { // Arrange var strategy = GetService <IFileSystemStrategy>(); var configuration = GetService <IAppConfiguration>(); var fs = strategy.Create(configuration.Options.WorkingDirectory); var expected = fs.Path.Combine(FileSystemHelper.BuildCurrentPath(string.Empty), path); // Act var result = fs.BuildAbsolutePath(path); // Assert Assert.AreEqual(expected, result); }
public void FileSystemExtensions_BuildAbsolutePath() { // Arrange var strategy = GetService <IFileSystemStrategy>(); var configuration = GetService <IAppConfiguration>(); var fs = strategy.Create(configuration.Options.WorkingDirectory); var expected = FileSystemHelper.BuildCurrentPath(string.Empty).TrimEnd(new[] { '/', '\\' }); // Act var result1 = fs.BuildAbsolutePath("."); var result2 = fs.BuildAbsolutePath("test"); // Assert Assert.AreEqual(expected, result1); Assert.AreEqual(fs.Path.Combine(expected, "test"), result2); }
public string GetDataPath(string filename) { return(Path.Combine(FileSystemHelper.BuildCurrentPath(), "data", filename)); }
public string GetImagesPath() { return(Path.Combine(FileSystemHelper.BuildCurrentPath(), "assets", "images")); }
public string GetTestPath() { return(Path.Combine(FileSystemHelper.BuildCurrentPath(), "data", "test")); }