Author: rolf
Date: 2007-03-16 19:26:26 -0500 (Fri, 16 Mar 2007)
New Revision: 74506
Modified:
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ChangeLog
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ComboBoxTest.cs
Log:
* ComboBoxTest.cs: Added DataBindingTest.
Modified:
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ChangeLog
2007-03-17 00:19:05 UTC (rev 74505)
+++ trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ChangeLog
2007-03-17 00:26:26 UTC (rev 74506)
@@ -1,3 +1,7 @@
+2007-03-17 Rolf Bjarne Kvinge <[EMAIL PROTECTED]>
+
+ * ComboBoxTest.cs: Added DataBindingTest.
+
2007-03-16 Rolf Bjarne Kvinge <[EMAIL PROTECTED]>
* MdiFormTest.cs: Make TopLevelTest not working until the fix is ready
Modified:
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ComboBoxTest.cs
===================================================================
---
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ComboBoxTest.cs
2007-03-17 00:19:05 UTC (rev 74505)
+++
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ComboBoxTest.cs
2007-03-17 00:26:26 UTC (rev 74506)
@@ -27,6 +27,8 @@
// Jordi Mas i Hernandez <[EMAIL PROTECTED]>
using System;
+using System.Data;
+using System.IO;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
@@ -55,7 +57,49 @@
{
Thread.CurrentThread.CurrentCulture = _originalCulture;
}
-
+
+ [Test] // bug 80794
+ public void DataBindingTest ()
+ {
+ string table =
+@"<?xml version=""1.0"" standalone=""yes""?>
+<DOK>
+<DOK>
+<klient>287</klient>
+</DOK>
+</DOK>
+";
+ string lookup =
+@"<?xml version=""1.0"" standalone=""yes""?>
+<klient>
+<klient>
+<nimi>FAILED</nimi>
+<kood>316</kood>
+</klient>
+<klient>
+<nimi>SUCCESS</nimi>
+<kood>287</kood>
+</klient>
+</klient>";
+
+ using (Form frm = new Form ()) {
+ frm.ShowInTaskbar = false;
+ DataSet dsTable = new DataSet ();
+ dsTable.ReadXml (new StringReader (table));
+ DataSet dsLookup = new DataSet ();
+ dsLookup.ReadXml (new StringReader (lookup));
+ ComboBox cb = new ComboBox ();
+ cb.DataSource = dsLookup.Tables [0];
+ cb.DisplayMember = "nimi";
+ cb.ValueMember = "kood";
+ cb.DataBindings.Add ("SelectedValue",
dsTable.Tables [0], "klient");
+ frm.Controls.Add (cb);
+ Assert.AreEqual ("", cb.Text, "#01");
+ frm.Show ();
+ Assert.AreEqual ("SUCCESS", cb.Text, "#02");
+ }
+ }
+
[Test]
public void ComboBoxPropertyTest ()
{
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches