Browse Source

add test for a <clear /> element with an illegal property

svn path=/trunk/mcs/; revision=50978
Chris Toshok 20 years ago
parent
commit
ad4c41db41

+ 1 - 1
mcs/class/System.Configuration/Test/standalone/Makefile

@@ -1,4 +1,4 @@
-TESTS = t1.exe t2.exe t3.exe t4.exe t5.exe t6.exe t7.exe t8.exe t9.exe
+TESTS = t1.exe t2.exe t3.exe t4.exe t5.exe t6.exe t7.exe t8.exe t9.exe t10.exe
 
 check:	local compare
 

+ 29 - 0
mcs/class/System.Configuration/Test/standalone/t10.cs

@@ -0,0 +1,29 @@
+using System;
+using System.Collections.Generic;
+using System.Collections.Specialized;
+using System.Text;
+using System.Configuration;
+using System.Web;
+
+class T1
+{
+	static void Main(string[] args)
+	{
+		try
+		{
+			Configuration config = ConfigurationManager.OpenExeConfiguration (ConfigurationUserLevel.None);
+			ConnectionStringsSection sect = config.ConnectionStrings;
+			ConnectionStringSettingsCollection connectionstrings = sect.ConnectionStrings;
+
+			connectionstrings.Add (new ConnectionStringSettings ("fromtest", "connectionstringhere"));
+
+			foreach (ConnectionStringSettings cs in connectionstrings) {
+				Console.WriteLine ("connectionstring[{0}] = `{1}',`{2}'", cs.Name, cs.ProviderName, cs.ConnectionString);
+			}
+		}
+		catch (ConfigurationErrorsException e)
+		{
+			Console.WriteLine ("ConfigurationErrorsException raised");
+		}
+	}
+}

+ 9 - 0
mcs/class/System.Configuration/Test/standalone/t10.exe.config

@@ -0,0 +1,9 @@
+<configuration>
+<connectionStrings>
+	<clear hi="bye"/>
+	<add name="LocalSqlServer"
+		connectionString="data source=127.0.0.1; Integrated Security=SSPI" />
+	<add name="AccessFileName"
+		connectionString="~/Data/ASPNetDB.mdb" />
+</connectionStrings>
+</configuration>

+ 1 - 0
mcs/class/System.Configuration/Test/standalone/t10.exe.expected

@@ -0,0 +1 @@
+ConfigurationErrorsException raised