public void Teardown() { if (ws != null) { ws.DeleteShare(); ws = null; } if (username != null) { Uhuru.Utilities.WindowsVCAPUsers.DeleteDecoratedBasedUser(username); } }
public void DeleteShare() { ws.AddSharePermission("Everyone"); Assert.IsTrue(ws.Exists()); Assert.IsTrue(WindowsShare.GetShares().Any(s => s == ws.ShareName)); ws.DeleteShare(); Assert.IsFalse(ws.Exists()); Assert.IsFalse(WindowsShare.GetShares().Any(s => s == ws.ShareName)); ws = null; string contentsRead = File.ReadAllText(@"\\localhost\" + shareName + @"\test.txt"); }
public void Setup() { tempPath = Path.GetTempPath(); shareName = DateTime.Now.Ticks.ToString(); shareForderPath = Directory.CreateDirectory(Path.Combine(tempPath, shareName)).FullName; testFileContent = "this is a test"; File.WriteAllText(Path.Combine(shareForderPath, "test.txt"), testFileContent); ws = WindowsShare.CreateShare(shareName, shareForderPath); username = Uhuru.Utilities.Credentials.GenerateCredential(); password = "******"; decoratedUsername = Uhuru.Utilities.WindowsVCAPUsers.CreateDecoratedUser(username, password); }