Add xml configuration section test (bug#39669)
authorAndi McClure <andi.mcclure@xamarin.com>
Tue, 19 Apr 2016 21:13:31 +0000 (17:13 -0400)
committerAndi McClure <andi.mcclure@xamarin.com>
Tue, 19 Apr 2016 21:13:31 +0000 (17:13 -0400)
mcs/class/System.Configuration/Test/standalone/Makefile
mcs/class/System.Configuration/Test/standalone/t48.cs [new file with mode: 0644]
mcs/class/System.Configuration/Test/standalone/t48.exe.config [new file with mode: 0644]
mcs/class/System.Configuration/Test/standalone/t48.exe.expected [new file with mode: 0644]

index a5e28c61bc530965d6a4110903bf9f74b0e8d612..1d4994c36f08b1de59848d3ea6104187346f05bd 100644 (file)
@@ -2,7 +2,7 @@ thisdir = class/System.Configuration/Test/standalone
 SUBDIRS = 
 include ../../../../build/rules.make
 
-TESTS = t1.exe t2.exe t3.exe t4.exe t5.exe t6.exe t7.exe t8.exe t9.exe t10.exe t11.exe t12.exe t15.exe t16.exe t17.exe t18.exe t19.exe t20.exe t21.exe t22.exe t23.exe t24.exe t25.exe t28.exe t29.exe t30.exe t31.exe t32.exe t33.exe t34.exe t35.exe t36.exe t37.exe t38.exe t39.exe t40.exe t41.exe t42.exe t43.exe t44.exe t45.exe t46.exe t47.exe
+TESTS = t1.exe t2.exe t3.exe t4.exe t5.exe t6.exe t7.exe t8.exe t9.exe t10.exe t11.exe t12.exe t15.exe t16.exe t17.exe t18.exe t19.exe t20.exe t21.exe t22.exe t23.exe t24.exe t25.exe t28.exe t29.exe t30.exe t31.exe t32.exe t33.exe t34.exe t35.exe t36.exe t37.exe t38.exe t39.exe t40.exe t41.exe t42.exe t43.exe t44.exe t45.exe t46.exe t47.exe t48.exe
 # t13.exe t14.exe t26.exe t27.exe
 
 check: local compare
diff --git a/mcs/class/System.Configuration/Test/standalone/t48.cs b/mcs/class/System.Configuration/Test/standalone/t48.cs
new file mode 100644 (file)
index 0000000..6d7bc05
--- /dev/null
@@ -0,0 +1,24 @@
+using System;
+using System.Collections;
+
+// Bugzilla #39669
+
+namespace TestConfigSection
+{
+       class Test
+       {
+               public static int Main (string[] args)
+               {
+                       Hashtable testCustomSection = (Hashtable)System.Configuration.ConfigurationManager.GetSection ("TestCustomSection");
+                       string proxyServer = (string)testCustomSection["ProxyServer"];
+
+                       if (proxyServer == null)
+                               throw new Exception("Custom section value is null");
+
+                       if (proxyServer != "server.example.com")
+                               throw new Exception("Custom section value is incorrect");
+
+                       return 0;
+               }
+       }
+}
diff --git a/mcs/class/System.Configuration/Test/standalone/t48.exe.config b/mcs/class/System.Configuration/Test/standalone/t48.exe.config
new file mode 100644 (file)
index 0000000..ebdf8a8
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<configuration>
+  <configSections>
+    <section name="TestCustomSection" type="System.Configuration.DictionarySectionHandler" />
+  </configSections>
+  <TestCustomSection>
+    <add key="ProxyServer" value="server.example.com" />
+    <add key="ConnectOnStart" value="false" />
+  </TestCustomSection>
+</configuration>
\ No newline at end of file
diff --git a/mcs/class/System.Configuration/Test/standalone/t48.exe.expected b/mcs/class/System.Configuration/Test/standalone/t48.exe.expected
new file mode 100644 (file)
index 0000000..e69de29