Пример #1
0
    public void CreateContentConnectionStringUsesSuperuserParameters()
    {
      var manager = new PgDbManager
      {
        Description = new PgDbDescription
        {
          ConnectionInfo = GlobalTest.Manager1.Description.ConnectionInfo,
          Superuser = new PgSuperuser { DatabaseName = "sudb", UserName = "******", Password = "******" }
        }
      };
                    
      using (var conn = manager.CreateContentConnection())
      {
        var result = new DbConnectionStringBuilder { ConnectionString = conn.ConnectionString };

        Assert.AreEqual(manager.Description.ConnectionInfo.DatabaseName, result[PgDbConnectionInfo.DatabaseNameKey]);
        Assert.AreEqual("suid", result[PgDbConnectionInfo.UserNameKey]);
        Assert.AreEqual("supw", result[PgDbConnectionInfo.PasswordKey]);
      }
    }