예제 #1
0
 public void GetInnerExceptionDescriptionTest()
 {
     try
     {
         DbManagerFactory.SetSqlFactory("Persist Security Info=true;Initial Catalog=xxx;Data Source=xxx;");
         using (DbManagerProxy manager = DbManagerFactory.Factory.Create())
         {
             manager.SetCommand("select 1;");
             manager.ExecuteNonQuery();
         }
     }
     catch (Exception ex)
     {
         string description = SqlExceptionHandler.GetExceptionDescription(ex);
         Assert.AreNotEqual(string.Empty, description);
     }
 }
예제 #2
0
 public void GetExceptionDescriptionTest()
 {
     try
     {
         using (var connection = new SqlConnection("Persist Security Info=true;Initial Catalog=xxx;Data Source=xxx;"))
         {
             connection.Open();
             SqlCommand command = connection.CreateCommand();
             command.CommandText = "select 1;";
             command.ExecuteNonQuery();
         }
     }
     catch (Exception ex)
     {
         string description = SqlExceptionHandler.GetExceptionDescription(ex);
         Assert.AreNotEqual(string.Empty, description);
     }
 }