public SecureStringPasswordProvider PasswordProviderCopy()
        {
            SecureStringPasswordProvider result = new SecureStringPasswordProvider();

            {
                result.encryptedLogin    = this.encryptedLogin.Copy();
                result.encryptedPassword = this.encryptedPassword.Copy();
            }

            return(result);
        }
    public void TestPasswordStorageAllowsWhitespaceLogin()
    {
      const string login = "******";
      const string password = "******";

      using (var passwordStorage = new SecureStringPasswordProvider(login, password))
      {
        Assert.AreEqual(login, passwordStorage.Username);
        Assert.AreEqual(password, passwordStorage.Password);
      }
    }
    public void TestPasswordStorageReturnsSameValues()
    {
      const string login = "******";
      const string password = "******";

      using (var passwordStorage = new SecureStringPasswordProvider(login, password))
      {
        Assert.AreEqual(login, passwordStorage.Username);
        Assert.AreEqual(password, passwordStorage.Password);
      }
    }
    public void TestPasswordStorageCopyReturnsSameValues()
    {
      const string login = "******";
      const string password = "******";

      using (var passwordStorage = new SecureStringPasswordProvider(login, password))
      {
        Assert.AreEqual(login, passwordStorage.Username);
        Assert.AreEqual(password, passwordStorage.Password);

        using (var passwordStorageCopy = passwordStorage.CredentialsShallowCopy())
        {
          Assert.AreNotSame(passwordStorage, passwordStorageCopy);

          Assert.AreEqual(login, passwordStorageCopy.Username);
          Assert.AreEqual(password, passwordStorageCopy.Password);
        }
      }
    }
    public void TestPasswordStorageAllowsNullPassword()
    {
      const string login = "******";
      const string password = null;

      using (var passwordStorage = new SecureStringPasswordProvider(login, password))
      {
        Assert.AreEqual(login, passwordStorage.Username);
        Assert.AreEqual(password, passwordStorage.Password);
      }
    }
    public SecureStringPasswordProvider PasswordProviderCopy()
    {
      SecureStringPasswordProvider result = new SecureStringPasswordProvider();
      {
        result.encryptedLogin = this.encryptedLogin.Copy();
        result.encryptedPassword = this.encryptedPassword.Copy();
      }

      return result;
    }