public void Hash_PasswordMatches_Accepts_Empty_String_Passwords()
 {
     _Hash = new Hash("");
     Assert.AreEqual(true, _Hash.PasswordMatches(""));
 }
 public void Hash_PasswordMatches_Returns_False_If_Password_Does_Not_Match()
 {
     _Hash = new Hash("This Is My Password");
     Assert.AreEqual(false, _Hash.PasswordMatches("This is My Password"));
 }
 public void Hash_PasswordMatches_Returns_True_If_Password_Matches()
 {
     _Hash = new Hash("This Is My Password");
     Assert.AreEqual(true, _Hash.PasswordMatches("This Is My Password"));
 }
 public void Hash_String_Creates_Latest_Hash()
 {
     _Hash = new Hash("Hello");
     Assert.AreEqual(Hash.LatestVersion, _Hash.Version);
     Assert.AreNotEqual(0, _Hash.Buffer.Count);
 }
 public void TestInitialise()
 {
     _Hash = new Hash();
 }
        /// <summary>
        /// Loads and applies the configuration from disk.
        /// </summary>
        /// <returns>True if the server should be restarted because of changes to the configuration.</returns>
        private bool LoadConfiguration()
        {
            var configuration = Factory.Singleton.Resolve<IConfigurationStorage>().Singleton.Load();

            bool result = false;
            lock(_AuthenticationSyncLock) {
                _BasicAuthenticationUser = configuration.WebServerSettings.BasicAuthenticationUser;
                _BasicAuthenticationPasswordHash = configuration.WebServerSettings.BasicAuthenticationPasswordHash;
                if(WebServer.AuthenticationScheme != configuration.WebServerSettings.AuthenticationScheme) {
                    result = true;
                    WebServer.AuthenticationScheme = configuration.WebServerSettings.AuthenticationScheme;
                }
            }

            foreach(var page in _Pages) {
                page.LoadConfiguration(configuration);
            }

            return result;
        }