// Author:
// Chris Toshok <toshok@ximian.com>
//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2005, 2006 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#define SPEW
+//#define SPEW
#if NET_2_0
}
}
+ class TestSettings4 : ApplicationSettingsBase {
+
+ public TestSettings4 ()
+ : base ("TestSettings4")
+ {
+ }
+
+ [ApplicationScopedSetting]
+ [DefaultSettingValue ("<?xml version=\"1.0\" encoding=\"utf-16\"?>\r\n<ArrayOfString xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">\r\n <string>go</string>\r\n <string>mono</string>\r\n </ArrayOfString>")]
+ public StringCollection Values {
+ get { return (StringCollection) this ["Values"]; }
+ }
+ }
+
[TestFixture]
public class ApplicationSettingsBaseTest
{
}
[Test]
- [Category ("NotWorking")]
public void TestSettings2_Properties ()
{
+ // This test will fail when there are newer versions
+ // of the test assemblies - so conditionalize it in
+ // such cases.
+#if TARGET_JVM
+ string expected = "MonoTests.System.Configuration.ProviderPoker, System.Test, Version=0.0.0.0";
+#else
+ string expected = "MonoTests.System.Configuration.ProviderPoker, System_test_net_2_0, Version=0.0.0.0";
+#endif
+ Assert.AreEqual (expected, new SettingsProviderAttribute (typeof (ProviderPoker)).ProviderTypeName.Substring (0, expected.Length), "#1");
TestSettings2 settings = new TestSettings2 ();
/* should throw ConfigurationException */
get { return ((int)(this ["IntSetting"])); }
}
}
- }
+ [Test]
+ public void TestSettings4_StringCollection_DefaultSettingValue ()
+ {
+ TestSettings4 settings = new TestSettings4 ();
+ Assert.AreEqual (2, settings.Values.Count, "Count");
+ Assert.AreEqual ("go", settings.Values[0], "0");
+ Assert.AreEqual ("mono", settings.Values[1], "1");
+ }
+
+ [Test]
+ [Category ("NotWorking")]
+ public void Providers ()
+ {
+ Assert.AreEqual (0, new TestSettings1 ().Providers.Count);
+ }
+ }
}
#endif