public void DomainNameWithUpperCasePrefix()
        {
            var sut = new DomainPath("LDAP://dc");

            Assert.AreEqual("LDAP://dc", sut.GetPathWithProtocol());
            Assert.AreEqual("dc", sut.GetPathWithoutProtocol());
        }
Exemplo n.º 2
0
        public void DomainNameWithUpperCasePrefix()
        {
            var sut = new DomainPath("LDAP://dc");

            Assert.AreEqual("LDAP://dc", sut.GetPathWithProtocol());
            Assert.AreEqual("dc", sut.GetPathWithoutProtocol());
        }
Exemplo n.º 3
0
        public void VerifyDomainPath()
        {
            try
            {
                if (!DomainPath.EndsWith("\\"))
                {
                    DomainPath += "\\";
                }

                Path.GetFullPath(DomainPath);
            }
            catch (Exception ex)
            {
                var newLine = Environment.NewLine;
                throw new ArgumentException(string.Concat("Domain Path invalid.", newLine, newLine, ex.Message));
            }
        }
Exemplo n.º 4
0
        private void EnsureLoaded()
        {
            if (Loaded)
            {
                return;
            }

            lock (loadlock)
            {
                if (!Loaded)
                {
                    loadedAssemblies.Clear();
                    if (!String.IsNullOrEmpty(DomainPath))
                    {
                        var paths   = DomainPath.Split(';');
                        var filters = FileFilter.Split('|');
                        foreach (var path in paths)
                        {
                            try
                            {
                                loadedAssemblies.AddRange(
                                    filters.SelectMany(s => Directory.GetFiles(path, s)).Select(Assembly.LoadFrom));
                                Loaded = true;
                            }
                            // Files should always exists but don't blow up here if they don't
                            catch (FileNotFoundException)
                            {
                            }
                            // File was found but could not be loaded
                            catch (FileLoadException)
                            {
                            }
                            // Dlls that contain native code are not loaded, but do not invalidate the Directory
                            catch (BadImageFormatException)
                            {
                            }
                            // Dlls that have missing Managed dependencies are not loaded, but do not invalidate the Directory
                            catch (ReflectionTypeLoadException)
                            {
                            }
                        }
                    }
                }
            }
        }
 public void DomainNameIsInitialized()
 {
     var sut = new DomainPath("dc");
     Assert.AreEqual("dc", sut.Value);
 }
Exemplo n.º 6
0
        public void DomainNameIsInitialized()
        {
            var sut = new DomainPath("dc");

            Assert.AreEqual("dc", sut.Value);
        }