public void SetUp() { directory = TestContext.CurrentContext.TestDirectory.Combine("subdir"); Directory.CreateDirectory(directory); try { uncDirectory = UncHelper.GetUncFromPath(directory); filePath = new StringBuilder(directory).Append(@"\").Append(Filename).ToString(); uncFilePath = UncHelper.GetUncFromPath(filePath); using (var writer = System.IO.File.CreateText(filePath)) { writer.WriteLine("test"); } Debug.Assert(File.Exists(uncFilePath)); } catch (Exception) { if (Directory.Exists(directory)) { Directory.Delete(directory, true); } throw; } }
public void SetUp() { directory = Path.Combine(TestContext.CurrentContext.TestDirectory, "subdir"); System.IO.Directory.CreateDirectory(directory); try { uncDirectory = UncHelper.GetUncFromPath(directory); filePath = new StringBuilder(directory).Append(@"\").Append(Filename).ToString(); uncFilePath = UncHelper.GetUncFromPath(filePath); using (var writer = System.IO.File.CreateText(filePath)) { writer.WriteLine("test"); } Debug.Assert(File.Exists(uncFilePath)); } catch (Exception ex) { Console.WriteLine("Exception " + ex.GetType().FullName + "occured\n" + ex.Message); if (System.IO.Directory.Exists(directory)) { System.IO.Directory.Delete(directory, true); } throw; } }
public static void ClassInitialize(TestContext context) { directory = Path.Combine(context.TestDir, "subdir"); System.IO.Directory.CreateDirectory(directory); try { uncDirectory = UncHelper.GetUncFromPath(directory); filePath = new StringBuilder(directory).Append(@"\").Append(Filename).ToString(); uncFilePath = UncHelper.GetUncFromPath(filePath); using (var writer = System.IO.File.CreateText(filePath)) { writer.WriteLine("test"); } Debug.Assert(File.Exists(uncFilePath)); } catch (Exception) { if (System.IO.Directory.Exists(directory)) { System.IO.Directory.Delete(directory, true); } throw; } }
public void BaselineDirectoryExists() { Assert.IsTrue(System.IO.Directory.Exists(UncHelper.GetUncFromPath("."))); }
public void BaselineDirectoryExists() => Assert.IsTrue(Directory.Exists(UncHelper.GetUncFromPath(".")));