Пример #1
0
 public void Teardown()
 {
     if (ws != null)
     {
         ws.DeleteShare();
         ws = null;
     }
     if (username != null)
     {
         Uhuru.Utilities.WindowsVCAPUsers.DeleteDecoratedBasedUser(username);
     }
 }
Пример #2
0
        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");
        }
Пример #3
0
        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);
        }