Example #1
0
 public void TestFixtureSetup()
 {
     //set up the directory searcher to use the correct server for these tests. Don't worry, we'll set it back again on tear down.
     m_serverInfo = Test_Helper.GetValuesFromRegistry();
     Test_Helper.SetupWsQADomain();
     DirectoryAnalyzer da = new DirectoryAnalyzer(true); //ensure that other tests haven't wiped the directory searcher settings
 }
 public void SetDirectory()
 {
     m_info = Test_Helper.GetValuesFromRegistry();
 }
Example #3
0
        public static ServerInfo GetValuesFromRegistry()
        {
			RegistryKey root = Registry.CurrentUser.CreateSubKey(@"SOFTWARE\Workshare\ProtectEnterprise\DirectorySearcher", RegistryKeyPermissionCheck.ReadSubTree);
            if (root == null)
				throw new SystemException(@"Failed to open the registry key [SOFTWARE\Workshare\ProtectEnterprise\DirectorySearcher].");

            string serverName = root.GetValue("Server", "").ToString();
            int port = (int)root.GetValue("Port", 0);
            string context = root.GetValue("Context", "").ToString();
            string userName = root.GetValue("User", "").ToString();
            string password = root.GetValue("Password", "").ToString();

            root.Close();

            Workshare.Policy.Crypto crypt = Workshare.Policy.Crypto.Instance;

            if (!string.IsNullOrEmpty(userName))
            {
                userName = crypt.DecryptData(userName);
            }

            if (!string.IsNullOrEmpty(password))
            {
                password = crypt.DecryptData(password);
            }

            ServerInfo info = new ServerInfo(serverName, port, context, userName, password);
            return info;
        }
 public void SetDirectory()
 {
     m_info = Test_Helper.GetValuesFromRegistry();
     Test_Helper.SetValuesInRegistry("10.10.3.115", 0, "", "DevBuild", "");
 }