// Authors:
// Rolf Bjarne Kvinge RKvinge@novell.com
-
using System;
using System.ComponentModel;
using System.Drawing;
private static void CheckCulture ()
{
- try {
- if (Environment.OSVersion.Platform == PlatformID.Win32Windows) {
- int LCID = GetUserDefaultLCID ();
- if ((new CultureInfo ("en-US")).LCID != LCID) {
- Assert.Ignore ("Must be called with us-english locale, current locale is: " + new CultureInfo (LCID).Name);
- return;
- }
+ if (!TestHelper.RunningOnUnix) {
+ int LCID = GetUserDefaultLCID ();
+ if ((new CultureInfo ("en-US")).LCID != LCID) {
+ Assert.Ignore ("Must be called with us-english locale, current locale is: " + new CultureInfo (LCID).Name);
}
- } catch (Exception ex) {
- //ignore any exceptions.
- TestHelper.RemoveWarning (ex);
}
if (Thread.CurrentThread.CurrentCulture.Name != "en-US") {
Assert.Ignore ("Must be called with us-english locale, current locale is: " + Thread.CurrentThread.CurrentCulture.Name);
- return;
}
}
+
#if NET_2_0
// Only use on Windows!
public static string GenerateCustomFormatTests ()
return builder.ToString ();
}
-#endif
-
-
+#endif
// On Windows this test must be called with en-US locale specified in the regional settings.
// There is no way to change this programmatically for the test to run correctly on other locales
Assert.AreEqual (@" 07-02", dt.Text, "#1423");
dt.CustomFormat = @"-yy-MM";
Assert.AreEqual (@"-07-02", dt.Text, "#1424");
-
-
}
}
[Test]
public void TextTest ()
{
+ CheckCulture ();
+
DateTimePicker dt = new DateTimePicker ();
EventLogger log = new EventLogger (dt);
DateTime tomorrow = DateTime.Today.AddDays (1);
-
+
log.Clear ();
dt.Value = tomorrow;
Assert.AreEqual ("", dt.Text, "#1");
{
DateTimePicker dt = new DateTimePicker ();
dt.Text = "abcdef";
-
}
}
-}
\ No newline at end of file
+}