예제 #1
0
        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;
            }
        }
예제 #2
0
 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;
     }
 }
예제 #3
0
 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;
     }
 }
예제 #4
0
 public void BaselineDirectoryExists()
 {
     Assert.IsTrue(System.IO.Directory.Exists(UncHelper.GetUncFromPath(".")));
 }
예제 #5
0
 public void BaselineDirectoryExists() => Assert.IsTrue(Directory.Exists(UncHelper.GetUncFromPath(".")));