| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183 |
- //
- // ControlStyleTest.cs (Auto-generated by GenerateControlStyleTest.cs).
- //
- // Author:
- // Peter Dennis Bartok ([email protected])
- //
- // (C) 2005 Novell, Inc. (http://www.novell.com)
- //
- using System;
- using System.Windows.Forms;
- using System.Drawing;
- using System.Reflection;
- using NUnit.Framework;
- namespace MonoTests.System.Windows.Forms {
- [TestFixture]
- public class TestControlStyle {
- static Array style_values = Enum.GetValues(typeof(ControlStyles));
- static string[] style_names = Enum.GetNames(typeof(ControlStyles));
- public void AssertAreEqual(string[] want, string[] got, string name) {
- if (want.Length == got.Length) {
- for (int i=0; i < want.Length; i++) {
- if (want[i] != got[i]) {
- Console.WriteLine("{0}: Expected {1}, got {2}", name, want[i], got[i]);
- }
- }
- }
- Assert.AreEqual(want, got, name);
- }
- public static void CheckStyles (Control ctrl, string msg, params ControlStyles [] ExpectedStyles)
- {
- MethodInfo method = ctrl.GetType ().GetMethod ("GetStyle", BindingFlags.ExactBinding | BindingFlags.NonPublic | BindingFlags.Instance, null, new Type [] {typeof(ControlStyles)}, null);
- Assert.IsNotNull (method, "Cannot complete test, didn't find GetStyle method on Control");
-
- string failed = "";
-
- if (ExpectedStyles == null)
- ExpectedStyles = new ControlStyles [0];
- foreach (ControlStyles style in Enum.GetValues (typeof(ControlStyles))) {
- bool result = (bool) method.Invoke (ctrl, new object [] {style});
- if (Array.IndexOf (ExpectedStyles, style) >= 0) {
- if (!result)
- failed += "\t" + "ControlStyles." + style.ToString () + " was expected, but is not set." + Environment.NewLine;
- } else {
- if (result)
- failed += "\t" + "ControlStyles." + style.ToString () + " is set, but was not expected." + Environment.NewLine;
- }
- }
- if (failed != String.Empty) {
- Assert.Fail (msg + Environment.NewLine + failed);
- }
- }
- public static string[] GetStyles(Control control) {
- string[] result;
- result = new string[style_names.Length];
- for (int i = 0; i < style_values.Length; i++) {
- result[i] = style_names[i] + "=" + control.GetType().GetMethod("GetStyle", BindingFlags.NonPublic | BindingFlags.Instance).Invoke(control, new object[1] {(ControlStyles)style_values.GetValue(i)});
- }
- return result;
- }
- [Test]
- public void ControlStyleTest ()
- {
- string[] Control_want = {
- "ContainerControl=False",
- "UserPaint=True",
- "Opaque=False",
- "ResizeRedraw=False",
- "FixedWidth=False",
- "FixedHeight=False",
- "StandardClick=True",
- "Selectable=True",
- "UserMouse=False",
- "SupportsTransparentBackColor=False",
- "StandardDoubleClick=True",
- "AllPaintingInWmPaint=True",
- "CacheText=False",
- "EnableNotifyMessage=False",
- "DoubleBuffer=False",
- #if NET_2_0
- "OptimizedDoubleBuffer=False",
- "UseTextForAccessibility=True"
- #endif
- };
- Assert.AreEqual(Control_want, GetStyles(new Control()), "ControlStyles");
- }
- [Test]
- public void ButtonStyleTest ()
- {
- string[] Button_want = {
- "ContainerControl=False",
- "UserPaint=True",
- "Opaque=True",
- "ResizeRedraw=True",
- "FixedWidth=False",
- "FixedHeight=False",
- "StandardClick=False",
- "Selectable=True",
- "UserMouse=True",
- "SupportsTransparentBackColor=True",
- "StandardDoubleClick=False",
- "AllPaintingInWmPaint=True",
- "CacheText=True",
- "EnableNotifyMessage=False",
- #if NET_2_0
- "DoubleBuffer=False",
- "OptimizedDoubleBuffer=True",
- "UseTextForAccessibility=True"
- #else
- "DoubleBuffer=True"
- #endif
- };
- Assert.AreEqual(Button_want, GetStyles(new Button()), "ButtonStyles");
- }
- [Test]
- public void CheckBoxStyleTest ()
- {
- string[] CheckBox_want = {
- "ContainerControl=False",
- "UserPaint=True",
- "Opaque=True",
- "ResizeRedraw=True",
- "FixedWidth=False",
- "FixedHeight=False",
- "StandardClick=False",
- "Selectable=True",
- "UserMouse=True",
- "SupportsTransparentBackColor=True",
- "StandardDoubleClick=False",
- "AllPaintingInWmPaint=True",
- "CacheText=True",
- "EnableNotifyMessage=False",
- #if NET_2_0
- "DoubleBuffer=False",
- "OptimizedDoubleBuffer=True",
- "UseTextForAccessibility=True"
- #else
- "DoubleBuffer=True"
- #endif
- };
- Assert.AreEqual(CheckBox_want, GetStyles(new CheckBox()), "CheckBoxStyles");
- }
- [Test]
- public void RadioButtonStyleTest ()
- {
- string[] RadioButton_want = {
- "ContainerControl=False",
- "UserPaint=True",
- "Opaque=True",
- "ResizeRedraw=True",
- "FixedWidth=False",
- "FixedHeight=False",
- "StandardClick=False",
- "Selectable=True",
- "UserMouse=True",
- "SupportsTransparentBackColor=True",
- "StandardDoubleClick=True",
- "AllPaintingInWmPaint=True",
- "CacheText=True",
- "EnableNotifyMessage=False",
- #if NET_2_0
- "DoubleBuffer=False",
- "OptimizedDoubleBuffer=True",
- "UseTextForAccessibility=True"
- #else
- "DoubleBuffer=True"
- #endif
- };
- Assert.AreEqual(RadioButton_want, GetStyles(new RadioButton()), "RadioButtonStyles");
- }
- [Test]
- public void DataGridStyleTest ()
- {
- string[] DataGrid_want = {
- "ContainerControl=False",
- "UserPaint=True",
- "Opaque=False",
- "ResizeRedraw=False",
- "FixedWidth=False",
- "FixedHeight=False",
- "StandardClick=True",
- "Selectable=True",
- "UserMouse=True",
- "SupportsTransparentBackColor=False",
- "StandardDoubleClick=True",
- "AllPaintingInWmPaint=True",
- "CacheText=False",
- "EnableNotifyMessage=False",
- "DoubleBuffer=False",
- #if NET_2_0
- "OptimizedDoubleBuffer=False",
- "UseTextForAccessibility=True"
- #endif
- };
- Assert.AreEqual(DataGrid_want, GetStyles(new DataGrid()), "DataGridStyles");
- }
- [Test]
- public void DateTimePickerStyleTest ()
- {
- string[] DateTimePicker_want = {
- "ContainerControl=False",
- "UserPaint=False",
- "Opaque=False",
- "ResizeRedraw=False",
- "FixedWidth=False",
- "FixedHeight=True",
- "StandardClick=False",
- "Selectable=True",
- "UserMouse=False",
- "SupportsTransparentBackColor=False",
- "StandardDoubleClick=True",
- "AllPaintingInWmPaint=True",
- "CacheText=False",
- "EnableNotifyMessage=False",
- "DoubleBuffer=False",
- #if NET_2_0
- "OptimizedDoubleBuffer=False",
- "UseTextForAccessibility=True"
- #endif
- };
- Assert.AreEqual(DateTimePicker_want, GetStyles(new DateTimePicker()), "DateTimePickerStyles");
- }
- [Test]
- public void GroupBoxStyleTest ()
- {
- string[] GroupBox_want = {
- "ContainerControl=True",
- "UserPaint=True",
- "Opaque=False",
- "ResizeRedraw=True",
- "FixedWidth=False",
- "FixedHeight=False",
- "StandardClick=True",
- "Selectable=False",
- "UserMouse=False",
- "SupportsTransparentBackColor=True",
- "StandardDoubleClick=True",
- "AllPaintingInWmPaint=True",
- "CacheText=False",
- "EnableNotifyMessage=False",
- "DoubleBuffer=False",
- #if NET_2_0
- "OptimizedDoubleBuffer=False",
- "UseTextForAccessibility=True"
- #endif
- };
- Assert.AreEqual(GroupBox_want, GetStyles(new GroupBox()), "GroupBoxStyles");
- }
- [Test]
- public void LabelStyleTest ()
- {
- string[] Label_want = {
- "ContainerControl=False",
- "UserPaint=True",
- "Opaque=False",
- "ResizeRedraw=True",
- "FixedWidth=False",
- "FixedHeight=False",
- "StandardClick=True",
- "Selectable=False",
- "UserMouse=False",
- "SupportsTransparentBackColor=True",
- "StandardDoubleClick=True",
- "AllPaintingInWmPaint=True",
- "CacheText=False",
- "EnableNotifyMessage=False",
- #if NET_2_0
- "DoubleBuffer=False",
- "OptimizedDoubleBuffer=True",
- "UseTextForAccessibility=True"
- #else
- "DoubleBuffer=True"
- #endif
- };
- Assert.AreEqual(Label_want, GetStyles(new Label()), "LabelStyles");
- }
- [Test]
- public void LinkLabelStyleTest ()
- {
- string[] LinkLabel_want = {
- "ContainerControl=False",
- "UserPaint=True",
- "Opaque=True",
- "ResizeRedraw=True",
- "FixedWidth=False",
- "FixedHeight=False",
- "StandardClick=True",
- "Selectable=False",
- "UserMouse=False",
- "SupportsTransparentBackColor=True",
- "StandardDoubleClick=True",
- "AllPaintingInWmPaint=True",
- "CacheText=False",
- "EnableNotifyMessage=False",
- #if NET_2_0
- "DoubleBuffer=False",
- "OptimizedDoubleBuffer=True",
- "UseTextForAccessibility=True"
- #else
- "DoubleBuffer=True"
- #endif
- };
- string[] LinkLabel_link_want = {
- "ContainerControl=False",
- "UserPaint=True",
- "Opaque=True",
- "ResizeRedraw=True",
- "FixedWidth=False",
- "FixedHeight=False",
- "StandardClick=True",
- "Selectable=True",
- "UserMouse=False",
- "SupportsTransparentBackColor=True",
- "StandardDoubleClick=True",
- "AllPaintingInWmPaint=True",
- "CacheText=False",
- "EnableNotifyMessage=False",
- #if NET_2_0
- "DoubleBuffer=False",
- "OptimizedDoubleBuffer=True",
- "UseTextForAccessibility=True"
- #else
- "DoubleBuffer=True"
- #endif
- };
- LinkLabel link = new LinkLabel ();
- // Test LinkLabel without text and without links
- Assert.AreEqual(LinkLabel_want, GetStyles(link), "#1");
- // Test LinkLabel with only text
- link.Text = "Users need not fear making the switch to Linux";
- link.Links.Clear ();
- Assert.AreEqual (LinkLabel_want, GetStyles (link), "#2");
- // Test LinkLabel with a link
- link.Links.Add (6, 9, "http://link1");
- Assert.AreEqual(LinkLabel_link_want, GetStyles(link), "#3");
- }
- [Test]
- public void ComboBoxStyleTest ()
- {
- string[] ComboBox_want = {
- "ContainerControl=False",
- "UserPaint=False",
- "Opaque=False",
- "ResizeRedraw=False",
- "FixedWidth=False",
- "FixedHeight=False",
- "StandardClick=False",
- "Selectable=True",
- "UserMouse=False",
- "SupportsTransparentBackColor=False",
- "StandardDoubleClick=True",
- "AllPaintingInWmPaint=True",
- "CacheText=False",
- "EnableNotifyMessage=False",
- "DoubleBuffer=False",
- #if NET_2_0
- "OptimizedDoubleBuffer=False",
- "UseTextForAccessibility=False"
- #endif
- };
- Assert.AreEqual(ComboBox_want, GetStyles(new ComboBox()), "ComboBoxStyles");
- }
- [Test]
- public void ListBoxStyleTest ()
- {
- string[] ListBox_want = {
- "ContainerControl=False",
- "UserPaint=False",
- "Opaque=False",
- "ResizeRedraw=False",
- "FixedWidth=False",
- "FixedHeight=False",
- "StandardClick=False",
- "Selectable=True",
- "UserMouse=False",
- "SupportsTransparentBackColor=False",
- "StandardDoubleClick=True",
- "AllPaintingInWmPaint=True",
- "CacheText=False",
- "EnableNotifyMessage=False",
- "DoubleBuffer=False",
- #if NET_2_0
- "OptimizedDoubleBuffer=False",
- "UseTextForAccessibility=False"
- #endif
- };
- Assert.AreEqual(ListBox_want, GetStyles(new ListBox()), "ListBoxStyles");
- }
- [Test]
- public void CheckedListBoxStyleTest ()
- {
- string[] CheckedListBox_want = {
- "ContainerControl=False",
- "UserPaint=False",
- "Opaque=False",
- "ResizeRedraw=True",
- "FixedWidth=False",
- "FixedHeight=False",
- "StandardClick=False",
- "Selectable=True",
- "UserMouse=False",
- "SupportsTransparentBackColor=False",
- "StandardDoubleClick=True",
- "AllPaintingInWmPaint=True",
- "CacheText=False",
- "EnableNotifyMessage=False",
- "DoubleBuffer=False",
- #if NET_2_0
- "OptimizedDoubleBuffer=False",
- "UseTextForAccessibility=False"
- #endif
- };
- Assert.AreEqual(CheckedListBox_want, GetStyles(new CheckedListBox()), "CheckedListBoxStyles");
- }
- [Test]
- public void ListViewStyleTest ()
- {
- string[] ListView_want = {
- "ContainerControl=False",
- "UserPaint=False",
- "Opaque=False",
- "ResizeRedraw=False",
- "FixedWidth=False",
- "FixedHeight=False",
- "StandardClick=False",
- "Selectable=True",
- "UserMouse=False",
- "SupportsTransparentBackColor=False",
- "StandardDoubleClick=True",
- "AllPaintingInWmPaint=True",
- "CacheText=False",
- "EnableNotifyMessage=False",
- "DoubleBuffer=False",
- #if NET_2_0
- "OptimizedDoubleBuffer=False",
- "UseTextForAccessibility=False"
- #endif
- };
- Assert.AreEqual(ListView_want, GetStyles(new ListView()), "ListViewStyles");
- }
- [Test]
- public void MdiClientStyleTest ()
- {
- string[] MdiClient_want = {
- "ContainerControl=False",
- "UserPaint=True",
- "Opaque=False",
- "ResizeRedraw=False",
- "FixedWidth=False",
- "FixedHeight=False",
- "StandardClick=True",
- "Selectable=False",
- "UserMouse=False",
- "SupportsTransparentBackColor=False",
- "StandardDoubleClick=True",
- "AllPaintingInWmPaint=True",
- "CacheText=False",
- "EnableNotifyMessage=False",
- "DoubleBuffer=False",
- #if NET_2_0
- "OptimizedDoubleBuffer=False",
- "UseTextForAccessibility=True"
- #endif
- };
- Assert.AreEqual(MdiClient_want, GetStyles(new MdiClient()), "MdiClientStyles");
- }
- [Test]
- public void MonthCalendarStyleTest ()
- {
- string[] MonthCalendar_want = {
- "ContainerControl=False",
- "UserPaint=False",
- "Opaque=False",
- "ResizeRedraw=False",
- "FixedWidth=False",
- "FixedHeight=False",
- "StandardClick=False",
- "Selectable=True",
- "UserMouse=False",
- "SupportsTransparentBackColor=False",
- "StandardDoubleClick=True",
- "AllPaintingInWmPaint=True",
- "CacheText=False",
- "EnableNotifyMessage=False",
- "DoubleBuffer=False",
- #if NET_2_0
- "OptimizedDoubleBuffer=False",
- "UseTextForAccessibility=True"
- #endif
- };
- Assert.AreEqual(MonthCalendar_want, GetStyles(new MonthCalendar()), "MonthCalendarStyles");
- }
- [Test]
- public void PictureBoxStyleTest ()
- {
- string[] PictureBox_want = {
- "ContainerControl=False",
- "UserPaint=True",
- "Opaque=False",
- "ResizeRedraw=False",
- "FixedWidth=False",
- "FixedHeight=False",
- "StandardClick=True",
- "Selectable=False",
- "UserMouse=False",
- "SupportsTransparentBackColor=True",
- "StandardDoubleClick=True",
- "AllPaintingInWmPaint=True",
- "CacheText=False",
- "EnableNotifyMessage=False",
- #if NET_2_0
- "DoubleBuffer=False",
- "OptimizedDoubleBuffer=True",
- "UseTextForAccessibility=True"
- #else
- "DoubleBuffer=True"
- #endif
- };
- Assert.AreEqual(PictureBox_want, GetStyles(new PictureBox()), "PictureBoxStyles");
- }
- [Test]
- public void ProgressBarStyleTest ()
- {
- string[] ProgressBar_want = {
- "ContainerControl=False",
- "UserPaint=False",
- "Opaque=False",
- "ResizeRedraw=False",
- "FixedWidth=False",
- "FixedHeight=False",
- "StandardClick=True",
- "Selectable=False",
- "UserMouse=False",
- "SupportsTransparentBackColor=False",
- "StandardDoubleClick=True",
- "AllPaintingInWmPaint=True",
- "CacheText=False",
- "EnableNotifyMessage=False",
- "DoubleBuffer=False",
- #if NET_2_0
- "OptimizedDoubleBuffer=False",
- "UseTextForAccessibility=False"
- #endif
- };
- Assert.AreEqual(ProgressBar_want, GetStyles(new ProgressBar()), "ProgressBarStyles");
- }
- [Test]
- public void ScrollableControlStyleTest ()
- {
- string[] ScrollableControl_want = {
- "ContainerControl=True",
- "UserPaint=True",
- "Opaque=False",
- "ResizeRedraw=False",
- "FixedWidth=False",
- "FixedHeight=False",
- "StandardClick=True",
- "Selectable=True",
- "UserMouse=False",
- "SupportsTransparentBackColor=False",
- "StandardDoubleClick=True",
- "AllPaintingInWmPaint=False",
- "CacheText=False",
- "EnableNotifyMessage=False",
- "DoubleBuffer=False",
- #if NET_2_0
- "OptimizedDoubleBuffer=False",
- "UseTextForAccessibility=True"
- #endif
- };
- Assert.AreEqual(ScrollableControl_want, GetStyles(new ScrollableControl()), "ScrollableControlStyles");
- }
- [Test]
- public void ContainerControlStyleTest ()
- {
- string[] ContainerControl_want = {
- "ContainerControl=True",
- "UserPaint=True",
- "Opaque=False",
- "ResizeRedraw=False",
- "FixedWidth=False",
- "FixedHeight=False",
- "StandardClick=True",
- "Selectable=True",
- "UserMouse=False",
- "SupportsTransparentBackColor=False",
- "StandardDoubleClick=True",
- "AllPaintingInWmPaint=False",
- "CacheText=False",
- "EnableNotifyMessage=False",
- "DoubleBuffer=False",
- #if NET_2_0
- "OptimizedDoubleBuffer=False",
- "UseTextForAccessibility=True"
- #endif
- };
- Assert.AreEqual(ContainerControl_want, GetStyles(new ContainerControl()), "ContainerControlStyles");
- }
- [Test]
- public void FormStyleTest ()
- {
- string[] Form_want = {
- "ContainerControl=True",
- "UserPaint=True",
- "Opaque=False",
- "ResizeRedraw=False",
- "FixedWidth=False",
- "FixedHeight=False",
- "StandardClick=True",
- "Selectable=True",
- "UserMouse=False",
- "SupportsTransparentBackColor=False",
- "StandardDoubleClick=True",
- "AllPaintingInWmPaint=False",
- "CacheText=False",
- "EnableNotifyMessage=False",
- "DoubleBuffer=False",
- #if NET_2_0
- "OptimizedDoubleBuffer=False",
- "UseTextForAccessibility=True"
- #endif
- };
- Form f = new Form ();
- f.ShowInTaskbar = false;
- Assert.AreEqual(Form_want, GetStyles(f), "FormStyles");
- f.Dispose ();
- }
- [Test]
- public void PropertyGridStyleTest ()
- {
- string[] PropertyGrid_want = {
- "ContainerControl=True",
- "UserPaint=True",
- "Opaque=False",
- "ResizeRedraw=False",
- "FixedWidth=False",
- "FixedHeight=False",
- "StandardClick=True",
- "Selectable=True",
- "UserMouse=False",
- "SupportsTransparentBackColor=False",
- "StandardDoubleClick=True",
- "AllPaintingInWmPaint=False",
- "CacheText=False",
- "EnableNotifyMessage=False",
- "DoubleBuffer=False",
- #if NET_2_0
- "OptimizedDoubleBuffer=False",
- "UseTextForAccessibility=True"
- #endif
- };
- Assert.AreEqual(PropertyGrid_want, GetStyles(new PropertyGrid()), "PropertyGridStyles");
- }
- [Test]
- public void DomainUpDownStyleTest ()
- {
- string[] DomainUpDown_want = {
- "ContainerControl=True",
- "UserPaint=True",
- #if NET_2_0
- "Opaque=True",
- "ResizeRedraw=True",
- #else
- "Opaque=False",
- "ResizeRedraw=False",
- #endif
- "FixedWidth=False",
- "FixedHeight=True",
- #if NET_2_0
- "StandardClick=False",
- #else
- "StandardClick=True",
- #endif
- "Selectable=True",
- "UserMouse=False",
- "SupportsTransparentBackColor=False",
- "StandardDoubleClick=True",
- "AllPaintingInWmPaint=False",
- "CacheText=False",
- "EnableNotifyMessage=False",
- "DoubleBuffer=False",
- #if NET_2_0
- "OptimizedDoubleBuffer=False",
- "UseTextForAccessibility=False"
- #endif
- };
- Assert.AreEqual(DomainUpDown_want, GetStyles(new DomainUpDown()), "DomainUpDownStyles");
- }
- [Test]
- public void NumericUpDownStyleTest ()
- {
- string[] NumericUpDown_want = {
- "ContainerControl=True",
- "UserPaint=True",
- #if NET_2_0
- "Opaque=True",
- "ResizeRedraw=True",
- #else
- "Opaque=False",
- "ResizeRedraw=False",
- #endif
- "FixedWidth=False",
- "FixedHeight=True",
- #if NET_2_0
- "StandardClick=False",
- #else
- "StandardClick=True",
- #endif
- "Selectable=True",
- "UserMouse=False",
- "SupportsTransparentBackColor=False",
- "StandardDoubleClick=True",
- "AllPaintingInWmPaint=False",
- "CacheText=False",
- "EnableNotifyMessage=False",
- "DoubleBuffer=False",
- #if NET_2_0
- "OptimizedDoubleBuffer=False",
- "UseTextForAccessibility=False"
- #endif
- };
- Assert.AreEqual(NumericUpDown_want, GetStyles(new NumericUpDown()), "NumericUpDownStyles");
- }
- [Test]
- public void UserControlStyleTest ()
- {
- string[] UserControl_want = {
- "ContainerControl=True",
- "UserPaint=True",
- "Opaque=False",
- "ResizeRedraw=False",
- "FixedWidth=False",
- "FixedHeight=False",
- "StandardClick=True",
- "Selectable=True",
- "UserMouse=False",
- #if NET_2_0
- "SupportsTransparentBackColor=True",
- #else
- "SupportsTransparentBackColor=False",
- #endif
- "StandardDoubleClick=True",
- "AllPaintingInWmPaint=False",
- "CacheText=False",
- "EnableNotifyMessage=False",
- "DoubleBuffer=False",
- #if NET_2_0
- "OptimizedDoubleBuffer=False",
- "UseTextForAccessibility=True"
- #endif
- };
- Assert.AreEqual(UserControl_want, GetStyles(new UserControl()), "UserControlStyles");
- }
- [Test]
- public void PanelStyleTest ()
- {
- string[] Panel_want = {
- "ContainerControl=True",
- "UserPaint=True",
- "Opaque=False",
- "ResizeRedraw=False",
- "FixedWidth=False",
- "FixedHeight=False",
- "StandardClick=True",
- "Selectable=False",
- "UserMouse=False",
- "SupportsTransparentBackColor=True",
- "StandardDoubleClick=True",
- "AllPaintingInWmPaint=False",
- "CacheText=False",
- "EnableNotifyMessage=False",
- "DoubleBuffer=False",
- #if NET_2_0
- "OptimizedDoubleBuffer=False",
- "UseTextForAccessibility=True"
- #endif
- };
- Assert.AreEqual(Panel_want, GetStyles(new Panel()), "PanelStyles");
- }
- [Test]
- public void TabPageStyleTest ()
- {
- string[] TabPage_want = {
- "ContainerControl=True",
- "UserPaint=True",
- "Opaque=False",
- "ResizeRedraw=False",
- "FixedWidth=False",
- "FixedHeight=False",
- "StandardClick=True",
- "Selectable=False",
- "UserMouse=False",
- "SupportsTransparentBackColor=True",
- "StandardDoubleClick=True",
- "AllPaintingInWmPaint=False",
- "CacheText=True",
- "EnableNotifyMessage=False",
- "DoubleBuffer=False",
- #if NET_2_0
- "OptimizedDoubleBuffer=False",
- "UseTextForAccessibility=True"
- #endif
- };
- Assert.AreEqual(TabPage_want, GetStyles(new TabPage()), "TabPageStyles");
- }
- [Test]
- public void HScrollBarStyleTest ()
- {
- string[] HScrollBar_want = {
- "ContainerControl=False",
- "UserPaint=False",
- "Opaque=False",
- "ResizeRedraw=False",
- "FixedWidth=False",
- "FixedHeight=False",
- "StandardClick=False",
- "Selectable=True",
- "UserMouse=False",
- "SupportsTransparentBackColor=False",
- "StandardDoubleClick=True",
- "AllPaintingInWmPaint=True",
- "CacheText=False",
- "EnableNotifyMessage=False",
- "DoubleBuffer=False",
- #if NET_2_0
- "OptimizedDoubleBuffer=False",
- "UseTextForAccessibility=False"
- #endif
- };
- Assert.AreEqual(HScrollBar_want, GetStyles(new HScrollBar()), "HScrollBarStyles");
- }
- [Test]
- public void VScrollBarStyleTest ()
- {
- string[] VScrollBar_want = {
- "ContainerControl=False",
- "UserPaint=False",
- "Opaque=False",
- "ResizeRedraw=False",
- "FixedWidth=False",
- "FixedHeight=False",
- "StandardClick=False",
- "Selectable=True",
- "UserMouse=False",
- "SupportsTransparentBackColor=False",
- "StandardDoubleClick=True",
- "AllPaintingInWmPaint=True",
- "CacheText=False",
- "EnableNotifyMessage=False",
- "DoubleBuffer=False",
- #if NET_2_0
- "OptimizedDoubleBuffer=False",
- "UseTextForAccessibility=False"
- #endif
- };
- Assert.AreEqual(VScrollBar_want, GetStyles(new VScrollBar()), "VScrollBarStyles");
- }
- [Test]
- public void SplitterStyleTest ()
- {
- string[] Splitter_want = {
- "ContainerControl=False",
- "UserPaint=True",
- "Opaque=False",
- "ResizeRedraw=False",
- "FixedWidth=False",
- "FixedHeight=False",
- "StandardClick=True",
- "Selectable=False",
- "UserMouse=False",
- "SupportsTransparentBackColor=False",
- "StandardDoubleClick=True",
- "AllPaintingInWmPaint=True",
- "CacheText=False",
- "EnableNotifyMessage=False",
- "DoubleBuffer=False",
- #if NET_2_0
- "OptimizedDoubleBuffer=False",
- "UseTextForAccessibility=True"
- #endif
- };
- Assert.AreEqual(Splitter_want, GetStyles(new Splitter()), "SplitterStyles");
- }
- [Test]
- public void StatusBarStyleTest ()
- {
- string[] StatusBar_want = {
- "ContainerControl=False",
- "UserPaint=False",
- "Opaque=False",
- "ResizeRedraw=False",
- "FixedWidth=False",
- "FixedHeight=False",
- "StandardClick=True",
- "Selectable=False",
- "UserMouse=False",
- "SupportsTransparentBackColor=False",
- "StandardDoubleClick=True",
- "AllPaintingInWmPaint=True",
- "CacheText=False",
- "EnableNotifyMessage=False",
- "DoubleBuffer=False",
- #if NET_2_0
- "OptimizedDoubleBuffer=False",
- "UseTextForAccessibility=True"
- #endif
- };
- Assert.AreEqual(StatusBar_want, GetStyles(new StatusBar()), "StatusBarStyles");
- }
- [Test]
- public void TabControlStyleTest ()
- {
- string[] TabControl_want = {
- "ContainerControl=False",
- "UserPaint=False",
- "Opaque=False",
- "ResizeRedraw=False",
- "FixedWidth=False",
- "FixedHeight=False",
- "StandardClick=True",
- "Selectable=True",
- "UserMouse=False",
- "SupportsTransparentBackColor=False",
- "StandardDoubleClick=True",
- "AllPaintingInWmPaint=True",
- "CacheText=False",
- "EnableNotifyMessage=False",
- "DoubleBuffer=False",
- #if NET_2_0
- "OptimizedDoubleBuffer=False",
- "UseTextForAccessibility=True"
- #endif
- };
- Assert.AreEqual(TabControl_want, GetStyles(new TabControl()), "TabControlStyles");
- }
- [Test]
- public void RichTextBoxStyleTest ()
- {
- string[] RichTextBox_want = {
- "ContainerControl=False",
- "UserPaint=False",
- "Opaque=False",
- "ResizeRedraw=False",
- "FixedWidth=False",
- "FixedHeight=False",
- "StandardClick=False",
- "Selectable=True",
- "UserMouse=False",
- "SupportsTransparentBackColor=False",
- #if NET_2_0
- "StandardDoubleClick=False",
- #else
- "StandardDoubleClick=True",
- #endif
- "AllPaintingInWmPaint=True",
- "CacheText=False",
- "EnableNotifyMessage=False",
- "DoubleBuffer=False",
- #if NET_2_0
- "OptimizedDoubleBuffer=False",
- "UseTextForAccessibility=False"
- #endif
- };
- Assert.AreEqual(RichTextBox_want, GetStyles(new RichTextBox()), "RichTextBoxStyles");
- }
- [Test]
- public void TextBoxStyleTest ()
- {
- string[] TextBox_want = {
- "ContainerControl=False",
- "UserPaint=False",
- "Opaque=False",
- "ResizeRedraw=False",
- "FixedWidth=False",
- "FixedHeight=True",
- "StandardClick=False",
- "Selectable=True",
- "UserMouse=False",
- "SupportsTransparentBackColor=False",
- "StandardDoubleClick=False",
- "AllPaintingInWmPaint=True",
- "CacheText=False",
- "EnableNotifyMessage=False",
- "DoubleBuffer=False",
- #if NET_2_0
- "OptimizedDoubleBuffer=False",
- "UseTextForAccessibility=False"
- #endif
- };
- Assert.AreEqual(TextBox_want, GetStyles(new TextBox()), "TextBoxStyles");
- }
- [Test]
- public void DataGridTextBoxStyleTest ()
- {
- string[] DataGridTextBox_want = {
- "ContainerControl=False",
- "UserPaint=False",
- "Opaque=False",
- "ResizeRedraw=False",
- "FixedWidth=False",
- "FixedHeight=True",
- "StandardClick=False",
- "Selectable=True",
- "UserMouse=False",
- "SupportsTransparentBackColor=False",
- "StandardDoubleClick=False",
- "AllPaintingInWmPaint=True",
- "CacheText=False",
- "EnableNotifyMessage=False",
- "DoubleBuffer=False",
- #if NET_2_0
- "OptimizedDoubleBuffer=False",
- "UseTextForAccessibility=False"
- #endif
- };
- Assert.AreEqual(DataGridTextBox_want, GetStyles(new DataGridTextBox()), "DataGridTextBoxStyles");
- }
- [Test]
- public void ToolBarStyleTest ()
- {
- string[] ToolBar_want = {
- "ContainerControl=False",
- "UserPaint=False",
- "Opaque=False",
- "ResizeRedraw=False",
- "FixedWidth=False",
- "FixedHeight=True",
- "StandardClick=True",
- "Selectable=True",
- "UserMouse=False",
- "SupportsTransparentBackColor=False",
- "StandardDoubleClick=True",
- "AllPaintingInWmPaint=True",
- "CacheText=False",
- "EnableNotifyMessage=False",
- "DoubleBuffer=False",
- #if NET_2_0
- "OptimizedDoubleBuffer=False",
- "UseTextForAccessibility=True"
- #endif
- };
- Assert.AreEqual(ToolBar_want, GetStyles(new ToolBar()), "ToolBarStyles");
- }
- [Test]
- public void TrackBarStyleTest ()
- {
- string[] TrackBar_want = {
- "ContainerControl=False",
- "UserPaint=False",
- "Opaque=False",
- "ResizeRedraw=False",
- "FixedWidth=False",
- "FixedHeight=False",
- "StandardClick=True",
- "Selectable=True",
- "UserMouse=False",
- "SupportsTransparentBackColor=False",
- "StandardDoubleClick=True",
- "AllPaintingInWmPaint=True",
- "CacheText=False",
- "EnableNotifyMessage=False",
- "DoubleBuffer=False",
- #if NET_2_0
- "OptimizedDoubleBuffer=False",
- "UseTextForAccessibility=False"
- #endif
- };
- Assert.AreEqual(TrackBar_want, GetStyles(new TrackBar()), "TrackBarStyles");
- }
- [Test]
- public void TreeViewStyleTest ()
- {
- string[] TreeView_want = {
- "ContainerControl=False",
- "UserPaint=False",
- "Opaque=False",
- "ResizeRedraw=False",
- "FixedWidth=False",
- "FixedHeight=False",
- "StandardClick=False",
- "Selectable=True",
- "UserMouse=False",
- "SupportsTransparentBackColor=False",
- "StandardDoubleClick=True",
- "AllPaintingInWmPaint=True",
- "CacheText=False",
- "EnableNotifyMessage=False",
- "DoubleBuffer=False",
- #if NET_2_0
- "OptimizedDoubleBuffer=False",
- "UseTextForAccessibility=False"
- #endif
- };
- Assert.AreEqual(TreeView_want, GetStyles(new TreeView()), "TreeViewStyles");
- }
- }
- }
|