private static void TestReadWriteAccessToShare() { string serverName = ConsoleTest.GetNextInput("Enter server name to test. End with Enter: ", Environment.MachineName); string shareName = ConsoleTest.GetNextInput("Enter share name to test. End with Enter: ", "Test"); ShareHelper.TestReadWriteAccessToShare(Logger, new UncPath(new ServerName(serverName), new ShareName(shareName))); ConsoleTest.GetNextInput("Press Enter to end test"); }
private static void TestCreateLocalShareWithAccessForEveryone(int runs) { string subDirectoryString = ConsoleTest.GetNextInput("Enter sub dircetory to test. End with Enter: ", "test"); string shareName = ConsoleTest.GetNextInput("Enter share name to test. End with Enter: ", "testShare"); string directoryString = DirectoryCreateAbsolutePath(subDirectoryString); Console.WriteLine(string.Format("Testing creation of local share {0} with absolute path {1} {2} timers for Everyone.", shareName, directoryString, runs)); for (int counter = 0; counter < runs; counter += 1) { ShareHelper.CreateLocalShareDirectoryIfNotExistingAndGiveEveryoneAccess(Logger, new DirectoryPath(directoryString), new ShareName(shareName)); } ConsoleTest.GetNextInput("Press Enter to clean up test"); try { Directory.Delete(directoryString, true); } catch (Exception) { Console.WriteLine("Delete failed"); } }