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(); } }
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(); } }