Beispiel #1
0
        public void TestCreateWithFileSecurity()
        {
            var tempLongPathFilename = uncDirectory.Combine(Path.GetRandomFileName());
            var di = new DirectoryInfo(tempLongPathFilename);

            try {
                di.Create(new DirectorySecurity());
                Assert.IsTrue(tempLongPathFilename.Exists());
            }
            finally {
                di.Delete();
            }
        }
Beispiel #2
0
        public void TestCreateSubdirectoryWithFileSecurity()
        {
            var           di             = new DirectoryInfo(uncDirectory);
            var           randomFileName = Path.GetRandomFileName();
            DirectoryInfo newDi          = null;

            try {
                newDi = di.CreateSubdirectory(randomFileName, new DirectorySecurity());
                Assert.IsNotNull(newDi);
                Assert.IsTrue(di.Exists);
            }
            finally {
                newDi?.Delete();
            }
        }