User: xtoff
Date: 2010/01/09 06:39 AM

Modified:
 /ActiveRecord/trunk/src/Castle.ActiveRecord.Tests/
  DefaultConfigurationsTestCase.cs
 /ActiveRecord/trunk/src/Castle.ActiveRecord/Framework/Config/
  XmlConfigurationSource.cs

Log:
 - fixed error message when invalid database attribute value is passed.

File Changes:

Directory: /ActiveRecord/trunk/src/Castle.ActiveRecord.Tests/
=============================================================

File [modified]: DefaultConfigurationsTestCase.cs
Delta lines: +0 -0
===================================================================

Directory: /ActiveRecord/trunk/src/Castle.ActiveRecord/Framework/Config/
========================================================================

File [modified]: XmlConfigurationSource.cs
Delta lines: +17 -0
===================================================================

--- 
ActiveRecord/trunk/src/Castle.ActiveRecord.Tests/DefaultConfigurationsTestCase.cs
   2010-01-09 13:19:52 UTC (rev 6605)
+++ 
ActiveRecord/trunk/src/Castle.ActiveRecord.Tests/DefaultConfigurationsTestCase.cs
   2010-01-09 13:39:21 UTC (rev 6606)
@@ -106,6 +106,23 @@
                }
 
                [Test]
+               public void Throws_when_invalid_database_specified()
+               {
+                       var value = @"<activerecord>
+       <config database=""IDontExist!"" connectionStringName=""foobar"" />
+</activerecord>";
+                       TestDelegate action = () =>
+
+                               BuildConfiguration(ReadConfiguration(value));
+
+                       var ex = 
Assert.Throws<ConfigurationErrorsException>(action);
+                       Assert.AreEqual(
+                               "Specified value (IDontExist!) is not valid for 
'database' attribute. Valid values are: 'MsSqlServer2000' 'MsSqlServer2005' 
'MsSqlServer2008' " +
+                               "'SQLite' 'MySql' 'MySql5' 'Firebird' 
'PostgreSQL' 'PostgreSQL81' 'PostgreSQL82' 'MsSqlCe' 'Oracle8i' 'Oracle9i' 
'Oracle10g'.",
+                               ex.Message);
+               }
+
+               [Test]
                public void Can_use_shorthand_attribute_form()
                {

-- 
You received this message because you are subscribed to the Google Groups 
"Castle Project Commits" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/castle-project-commits?hl=en.


Reply via email to