ControlStyleTest.cs 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998
  1. //
  2. // ControlStyleTest.cs (Auto-generated by GenerateControlStyleTest.cs).
  3. //
  4. // Author:
  5. // Peter Dennis Bartok ([email protected])
  6. //
  7. // (C) 2005 Novell, Inc. (http://www.novell.com)
  8. //
  9. using System;
  10. using System.Windows.Forms;
  11. using System.Drawing;
  12. using System.Reflection;
  13. using NUnit.Framework;
  14. namespace MonoTests.System.Windows.Forms {
  15. [TestFixture]
  16. public class TestControlStyle {
  17. static Array style_values = Enum.GetValues(typeof(ControlStyles));
  18. static string[] style_names = Enum.GetNames(typeof(ControlStyles));
  19. public void AssertAreEqual(string[] want, string[] got, string name) {
  20. if (want.Length == got.Length) {
  21. for (int i=0; i < want.Length; i++) {
  22. if (want[i] != got[i]) {
  23. Console.WriteLine("{0}: Expected {1}, got {2}", name, want[i], got[i]);
  24. }
  25. }
  26. }
  27. Assert.AreEqual(want, got, name);
  28. }
  29. public static string[] GetStyles(Control control) {
  30. string[] result;
  31. result = new string[style_names.Length];
  32. for (int i = 0; i < style_values.Length; i++) {
  33. result[i] = style_names[i] + "=" + control.GetType().GetMethod("GetStyle", BindingFlags.NonPublic | BindingFlags.Instance).Invoke(control, new object[1] {(ControlStyles)style_values.GetValue(i)});
  34. }
  35. return result;
  36. }
  37. [Test]
  38. public void ControlStyleTest ()
  39. {
  40. string[] Control_want = {
  41. "ContainerControl=False",
  42. "UserPaint=True",
  43. "Opaque=False",
  44. "ResizeRedraw=False",
  45. "FixedWidth=False",
  46. "FixedHeight=False",
  47. "StandardClick=True",
  48. "Selectable=True",
  49. "UserMouse=False",
  50. "SupportsTransparentBackColor=False",
  51. "StandardDoubleClick=True",
  52. "AllPaintingInWmPaint=True",
  53. "CacheText=False",
  54. "EnableNotifyMessage=False",
  55. "DoubleBuffer=False"
  56. };
  57. Assert.AreEqual(Control_want, GetStyles(new Control()), "ControlStyles");
  58. }
  59. [Test]
  60. public void ButtonStyleTest ()
  61. {
  62. string[] Button_want = {
  63. "ContainerControl=False",
  64. "UserPaint=True",
  65. "Opaque=True",
  66. "ResizeRedraw=True",
  67. "FixedWidth=False",
  68. "FixedHeight=False",
  69. "StandardClick=False",
  70. "Selectable=True",
  71. "UserMouse=True",
  72. "SupportsTransparentBackColor=True",
  73. "StandardDoubleClick=False",
  74. "AllPaintingInWmPaint=True",
  75. "CacheText=True",
  76. "EnableNotifyMessage=False",
  77. "DoubleBuffer=True"
  78. };
  79. Assert.AreEqual(Button_want, GetStyles(new Button()), "ButtonStyles");
  80. }
  81. [Test]
  82. public void CheckBoxStyleTest ()
  83. {
  84. string[] CheckBox_want = {
  85. "ContainerControl=False",
  86. "UserPaint=True",
  87. "Opaque=True",
  88. "ResizeRedraw=True",
  89. "FixedWidth=False",
  90. "FixedHeight=False",
  91. "StandardClick=False",
  92. "Selectable=True",
  93. "UserMouse=True",
  94. "SupportsTransparentBackColor=True",
  95. "StandardDoubleClick=False",
  96. "AllPaintingInWmPaint=True",
  97. "CacheText=True",
  98. "EnableNotifyMessage=False",
  99. "DoubleBuffer=True"
  100. };
  101. Assert.AreEqual(CheckBox_want, GetStyles(new CheckBox()), "CheckBoxStyles");
  102. }
  103. [Test]
  104. public void RadioButtonStyleTest ()
  105. {
  106. string[] RadioButton_want = {
  107. "ContainerControl=False",
  108. "UserPaint=True",
  109. "Opaque=True",
  110. "ResizeRedraw=True",
  111. "FixedWidth=False",
  112. "FixedHeight=False",
  113. "StandardClick=False",
  114. "Selectable=True",
  115. "UserMouse=True",
  116. "SupportsTransparentBackColor=True",
  117. "StandardDoubleClick=True",
  118. "AllPaintingInWmPaint=True",
  119. "CacheText=True",
  120. "EnableNotifyMessage=False",
  121. "DoubleBuffer=True"
  122. };
  123. Assert.AreEqual(RadioButton_want, GetStyles(new RadioButton()), "RadioButtonStyles");
  124. }
  125. [Test]
  126. public void DataGridStyleTest ()
  127. {
  128. string[] DataGrid_want = {
  129. "ContainerControl=False",
  130. "UserPaint=True",
  131. "Opaque=False",
  132. "ResizeRedraw=False",
  133. "FixedWidth=False",
  134. "FixedHeight=False",
  135. "StandardClick=True",
  136. "Selectable=True",
  137. "UserMouse=True",
  138. "SupportsTransparentBackColor=False",
  139. "StandardDoubleClick=True",
  140. "AllPaintingInWmPaint=True",
  141. "CacheText=False",
  142. "EnableNotifyMessage=False",
  143. "DoubleBuffer=False"
  144. };
  145. Assert.AreEqual(DataGrid_want, GetStyles(new DataGrid()), "DataGridStyles");
  146. }
  147. [Test]
  148. public void DateTimePickerStyleTest ()
  149. {
  150. string[] DateTimePicker_want = {
  151. "ContainerControl=False",
  152. "UserPaint=False",
  153. "Opaque=False",
  154. "ResizeRedraw=False",
  155. "FixedWidth=False",
  156. "FixedHeight=True",
  157. "StandardClick=False",
  158. "Selectable=True",
  159. "UserMouse=False",
  160. "SupportsTransparentBackColor=False",
  161. "StandardDoubleClick=True",
  162. "AllPaintingInWmPaint=True",
  163. "CacheText=False",
  164. "EnableNotifyMessage=False",
  165. "DoubleBuffer=False"
  166. };
  167. Assert.AreEqual(DateTimePicker_want, GetStyles(new DateTimePicker()), "DateTimePickerStyles");
  168. }
  169. [Test]
  170. public void GroupBoxStyleTest ()
  171. {
  172. string[] GroupBox_want = {
  173. "ContainerControl=True",
  174. "UserPaint=True",
  175. "Opaque=False",
  176. "ResizeRedraw=True",
  177. "FixedWidth=False",
  178. "FixedHeight=False",
  179. "StandardClick=True",
  180. "Selectable=False",
  181. "UserMouse=False",
  182. "SupportsTransparentBackColor=True",
  183. "StandardDoubleClick=True",
  184. "AllPaintingInWmPaint=True",
  185. "CacheText=False",
  186. "EnableNotifyMessage=False",
  187. "DoubleBuffer=False"
  188. };
  189. Assert.AreEqual(GroupBox_want, GetStyles(new GroupBox()), "GroupBoxStyles");
  190. }
  191. [Test]
  192. public void LabelStyleTest ()
  193. {
  194. string[] Label_want = {
  195. "ContainerControl=False",
  196. "UserPaint=True",
  197. "Opaque=False",
  198. "ResizeRedraw=True",
  199. "FixedWidth=False",
  200. "FixedHeight=False",
  201. "StandardClick=True",
  202. "Selectable=False",
  203. "UserMouse=False",
  204. "SupportsTransparentBackColor=True",
  205. "StandardDoubleClick=True",
  206. "AllPaintingInWmPaint=True",
  207. "CacheText=False",
  208. "EnableNotifyMessage=False",
  209. "DoubleBuffer=True"
  210. };
  211. Assert.AreEqual(Label_want, GetStyles(new Label()), "LabelStyles");
  212. }
  213. [Test]
  214. public void LinkLabelStyleTest ()
  215. {
  216. string[] LinkLabel_want = {
  217. "ContainerControl=False",
  218. "UserPaint=True",
  219. "Opaque=True",
  220. "ResizeRedraw=True",
  221. "FixedWidth=False",
  222. "FixedHeight=False",
  223. "StandardClick=True",
  224. "Selectable=False",
  225. "UserMouse=False",
  226. "SupportsTransparentBackColor=True",
  227. "StandardDoubleClick=True",
  228. "AllPaintingInWmPaint=True",
  229. "CacheText=False",
  230. "EnableNotifyMessage=False",
  231. "DoubleBuffer=True"
  232. };
  233. string[] LinkLabel_link_want = {
  234. "ContainerControl=False",
  235. "UserPaint=True",
  236. "Opaque=True",
  237. "ResizeRedraw=True",
  238. "FixedWidth=False",
  239. "FixedHeight=False",
  240. "StandardClick=True",
  241. "Selectable=True",
  242. "UserMouse=False",
  243. "SupportsTransparentBackColor=True",
  244. "StandardDoubleClick=True",
  245. "AllPaintingInWmPaint=True",
  246. "CacheText=False",
  247. "EnableNotifyMessage=False",
  248. "DoubleBuffer=True"
  249. };
  250. Assert.AreEqual(LinkLabel_want, GetStyles(new LinkLabel()), "LinkLabelStyles");
  251. // Test LinkLabel with a link
  252. LinkLabel link = new LinkLabel();
  253. link.Text = "Users need not fear making the switch to Linux";
  254. link.Links.Add (6,9, "http://link1");
  255. Assert.AreEqual(LinkLabel_link_want, GetStyles(link), "LinkLabelStyles2");
  256. }
  257. [Test]
  258. public void ComboBoxStyleTest ()
  259. {
  260. string[] ComboBox_want = {
  261. "ContainerControl=False",
  262. "UserPaint=False",
  263. "Opaque=False",
  264. "ResizeRedraw=False",
  265. "FixedWidth=False",
  266. "FixedHeight=False",
  267. "StandardClick=False",
  268. "Selectable=True",
  269. "UserMouse=False",
  270. "SupportsTransparentBackColor=False",
  271. "StandardDoubleClick=True",
  272. "AllPaintingInWmPaint=True",
  273. "CacheText=False",
  274. "EnableNotifyMessage=False",
  275. "DoubleBuffer=False"
  276. };
  277. Assert.AreEqual(ComboBox_want, GetStyles(new ComboBox()), "ComboBoxStyles");
  278. }
  279. [Test]
  280. public void ListBoxStyleTest ()
  281. {
  282. string[] ListBox_want = {
  283. "ContainerControl=False",
  284. "UserPaint=False",
  285. "Opaque=False",
  286. "ResizeRedraw=False",
  287. "FixedWidth=False",
  288. "FixedHeight=False",
  289. "StandardClick=False",
  290. "Selectable=True",
  291. "UserMouse=False",
  292. "SupportsTransparentBackColor=False",
  293. "StandardDoubleClick=True",
  294. "AllPaintingInWmPaint=True",
  295. "CacheText=False",
  296. "EnableNotifyMessage=False",
  297. "DoubleBuffer=False"
  298. };
  299. Assert.AreEqual(ListBox_want, GetStyles(new ListBox()), "ListBoxStyles");
  300. }
  301. [Test]
  302. public void CheckedListBoxStyleTest ()
  303. {
  304. string[] CheckedListBox_want = {
  305. "ContainerControl=False",
  306. "UserPaint=False",
  307. "Opaque=False",
  308. "ResizeRedraw=True",
  309. "FixedWidth=False",
  310. "FixedHeight=False",
  311. "StandardClick=False",
  312. "Selectable=True",
  313. "UserMouse=False",
  314. "SupportsTransparentBackColor=False",
  315. "StandardDoubleClick=True",
  316. "AllPaintingInWmPaint=True",
  317. "CacheText=False",
  318. "EnableNotifyMessage=False",
  319. "DoubleBuffer=False"
  320. };
  321. Assert.AreEqual(CheckedListBox_want, GetStyles(new CheckedListBox()), "CheckedListBoxStyles");
  322. }
  323. [Test]
  324. public void ListViewStyleTest ()
  325. {
  326. string[] ListView_want = {
  327. "ContainerControl=False",
  328. "UserPaint=False",
  329. "Opaque=False",
  330. "ResizeRedraw=False",
  331. "FixedWidth=False",
  332. "FixedHeight=False",
  333. "StandardClick=False",
  334. "Selectable=True",
  335. "UserMouse=False",
  336. "SupportsTransparentBackColor=False",
  337. "StandardDoubleClick=True",
  338. "AllPaintingInWmPaint=True",
  339. "CacheText=False",
  340. "EnableNotifyMessage=False",
  341. "DoubleBuffer=False"
  342. };
  343. Assert.AreEqual(ListView_want, GetStyles(new ListView()), "ListViewStyles");
  344. }
  345. [Test]
  346. public void MdiClientStyleTest ()
  347. {
  348. string[] MdiClient_want = {
  349. "ContainerControl=False",
  350. "UserPaint=True",
  351. "Opaque=False",
  352. "ResizeRedraw=False",
  353. "FixedWidth=False",
  354. "FixedHeight=False",
  355. "StandardClick=True",
  356. "Selectable=False",
  357. "UserMouse=False",
  358. "SupportsTransparentBackColor=False",
  359. "StandardDoubleClick=True",
  360. "AllPaintingInWmPaint=True",
  361. "CacheText=False",
  362. "EnableNotifyMessage=False",
  363. "DoubleBuffer=False"
  364. };
  365. Assert.AreEqual(MdiClient_want, GetStyles(new MdiClient()), "MdiClientStyles");
  366. }
  367. [Test]
  368. public void MonthCalendarStyleTest ()
  369. {
  370. string[] MonthCalendar_want = {
  371. "ContainerControl=False",
  372. "UserPaint=False",
  373. "Opaque=False",
  374. "ResizeRedraw=False",
  375. "FixedWidth=False",
  376. "FixedHeight=False",
  377. "StandardClick=False",
  378. "Selectable=True",
  379. "UserMouse=False",
  380. "SupportsTransparentBackColor=False",
  381. "StandardDoubleClick=True",
  382. "AllPaintingInWmPaint=True",
  383. "CacheText=False",
  384. "EnableNotifyMessage=False",
  385. "DoubleBuffer=False"
  386. };
  387. Assert.AreEqual(MonthCalendar_want, GetStyles(new MonthCalendar()), "MonthCalendarStyles");
  388. }
  389. [Test]
  390. public void PictureBoxStyleTest ()
  391. {
  392. string[] PictureBox_want = {
  393. "ContainerControl=False",
  394. "UserPaint=True",
  395. "Opaque=False",
  396. "ResizeRedraw=False",
  397. "FixedWidth=False",
  398. "FixedHeight=False",
  399. "StandardClick=True",
  400. "Selectable=False",
  401. "UserMouse=False",
  402. "SupportsTransparentBackColor=True",
  403. "StandardDoubleClick=True",
  404. "AllPaintingInWmPaint=True",
  405. "CacheText=False",
  406. "EnableNotifyMessage=False",
  407. "DoubleBuffer=True"
  408. };
  409. Assert.AreEqual(PictureBox_want, GetStyles(new PictureBox()), "PictureBoxStyles");
  410. }
  411. [Test]
  412. public void ProgressBarStyleTest ()
  413. {
  414. string[] ProgressBar_want = {
  415. "ContainerControl=False",
  416. "UserPaint=False",
  417. "Opaque=False",
  418. "ResizeRedraw=False",
  419. "FixedWidth=False",
  420. "FixedHeight=False",
  421. "StandardClick=True",
  422. "Selectable=False",
  423. "UserMouse=False",
  424. "SupportsTransparentBackColor=False",
  425. "StandardDoubleClick=True",
  426. "AllPaintingInWmPaint=True",
  427. "CacheText=False",
  428. "EnableNotifyMessage=False",
  429. "DoubleBuffer=False"
  430. };
  431. Assert.AreEqual(ProgressBar_want, GetStyles(new ProgressBar()), "ProgressBarStyles");
  432. }
  433. [Test]
  434. public void ScrollableControlStyleTest ()
  435. {
  436. string[] ScrollableControl_want = {
  437. "ContainerControl=True",
  438. "UserPaint=True",
  439. "Opaque=False",
  440. "ResizeRedraw=False",
  441. "FixedWidth=False",
  442. "FixedHeight=False",
  443. "StandardClick=True",
  444. "Selectable=True",
  445. "UserMouse=False",
  446. "SupportsTransparentBackColor=False",
  447. "StandardDoubleClick=True",
  448. "AllPaintingInWmPaint=False",
  449. "CacheText=False",
  450. "EnableNotifyMessage=False",
  451. "DoubleBuffer=False"
  452. };
  453. Assert.AreEqual(ScrollableControl_want, GetStyles(new ScrollableControl()), "ScrollableControlStyles");
  454. }
  455. [Test]
  456. public void ContainerControlStyleTest ()
  457. {
  458. string[] ContainerControl_want = {
  459. "ContainerControl=True",
  460. "UserPaint=True",
  461. "Opaque=False",
  462. "ResizeRedraw=False",
  463. "FixedWidth=False",
  464. "FixedHeight=False",
  465. "StandardClick=True",
  466. "Selectable=True",
  467. "UserMouse=False",
  468. "SupportsTransparentBackColor=False",
  469. "StandardDoubleClick=True",
  470. "AllPaintingInWmPaint=False",
  471. "CacheText=False",
  472. "EnableNotifyMessage=False",
  473. "DoubleBuffer=False"
  474. };
  475. Assert.AreEqual(ContainerControl_want, GetStyles(new ContainerControl()), "ContainerControlStyles");
  476. }
  477. [Test]
  478. public void FormStyleTest ()
  479. {
  480. string[] Form_want = {
  481. "ContainerControl=True",
  482. "UserPaint=True",
  483. "Opaque=False",
  484. "ResizeRedraw=False",
  485. "FixedWidth=False",
  486. "FixedHeight=False",
  487. "StandardClick=True",
  488. "Selectable=True",
  489. "UserMouse=False",
  490. "SupportsTransparentBackColor=False",
  491. "StandardDoubleClick=True",
  492. "AllPaintingInWmPaint=False",
  493. "CacheText=False",
  494. "EnableNotifyMessage=False",
  495. "DoubleBuffer=False"
  496. };
  497. Assert.AreEqual(Form_want, GetStyles(new Form()), "FormStyles");
  498. }
  499. [Test]
  500. public void PropertyGridStyleTest ()
  501. {
  502. string[] PropertyGrid_want = {
  503. "ContainerControl=True",
  504. "UserPaint=True",
  505. "Opaque=False",
  506. "ResizeRedraw=False",
  507. "FixedWidth=False",
  508. "FixedHeight=False",
  509. "StandardClick=True",
  510. "Selectable=True",
  511. "UserMouse=False",
  512. "SupportsTransparentBackColor=False",
  513. "StandardDoubleClick=True",
  514. "AllPaintingInWmPaint=False",
  515. "CacheText=False",
  516. "EnableNotifyMessage=False",
  517. "DoubleBuffer=False"
  518. };
  519. Assert.AreEqual(PropertyGrid_want, GetStyles(new PropertyGrid()), "PropertyGridStyles");
  520. }
  521. [Test]
  522. public void DomainUpDownStyleTest ()
  523. {
  524. string[] DomainUpDown_want = {
  525. "ContainerControl=True",
  526. "UserPaint=True",
  527. "Opaque=False",
  528. "ResizeRedraw=False",
  529. "FixedWidth=False",
  530. "FixedHeight=True",
  531. "StandardClick=True",
  532. "Selectable=True",
  533. "UserMouse=False",
  534. "SupportsTransparentBackColor=False",
  535. "StandardDoubleClick=True",
  536. "AllPaintingInWmPaint=False",
  537. "CacheText=False",
  538. "EnableNotifyMessage=False",
  539. "DoubleBuffer=False"
  540. };
  541. Assert.AreEqual(DomainUpDown_want, GetStyles(new DomainUpDown()), "DomainUpDownStyles");
  542. }
  543. [Test]
  544. public void NumericUpDownStyleTest ()
  545. {
  546. string[] NumericUpDown_want = {
  547. "ContainerControl=True",
  548. "UserPaint=True",
  549. "Opaque=False",
  550. "ResizeRedraw=False",
  551. "FixedWidth=False",
  552. "FixedHeight=True",
  553. "StandardClick=True",
  554. "Selectable=True",
  555. "UserMouse=False",
  556. "SupportsTransparentBackColor=False",
  557. "StandardDoubleClick=True",
  558. "AllPaintingInWmPaint=False",
  559. "CacheText=False",
  560. "EnableNotifyMessage=False",
  561. "DoubleBuffer=False"
  562. };
  563. Assert.AreEqual(NumericUpDown_want, GetStyles(new NumericUpDown()), "NumericUpDownStyles");
  564. }
  565. [Test]
  566. public void UserControlStyleTest ()
  567. {
  568. string[] UserControl_want = {
  569. "ContainerControl=True",
  570. "UserPaint=True",
  571. "Opaque=False",
  572. "ResizeRedraw=False",
  573. "FixedWidth=False",
  574. "FixedHeight=False",
  575. "StandardClick=True",
  576. "Selectable=True",
  577. "UserMouse=False",
  578. "SupportsTransparentBackColor=False",
  579. "StandardDoubleClick=True",
  580. "AllPaintingInWmPaint=False",
  581. "CacheText=False",
  582. "EnableNotifyMessage=False",
  583. "DoubleBuffer=False"
  584. };
  585. Assert.AreEqual(UserControl_want, GetStyles(new UserControl()), "UserControlStyles");
  586. }
  587. [Test]
  588. public void PanelStyleTest ()
  589. {
  590. string[] Panel_want = {
  591. "ContainerControl=True",
  592. "UserPaint=True",
  593. "Opaque=False",
  594. "ResizeRedraw=False",
  595. "FixedWidth=False",
  596. "FixedHeight=False",
  597. "StandardClick=True",
  598. "Selectable=False",
  599. "UserMouse=False",
  600. "SupportsTransparentBackColor=True",
  601. "StandardDoubleClick=True",
  602. "AllPaintingInWmPaint=False",
  603. "CacheText=False",
  604. "EnableNotifyMessage=False",
  605. "DoubleBuffer=False"
  606. };
  607. Assert.AreEqual(Panel_want, GetStyles(new Panel()), "PanelStyles");
  608. }
  609. [Test]
  610. public void TabPageStyleTest ()
  611. {
  612. string[] TabPage_want = {
  613. "ContainerControl=True",
  614. "UserPaint=True",
  615. "Opaque=False",
  616. "ResizeRedraw=False",
  617. "FixedWidth=False",
  618. "FixedHeight=False",
  619. "StandardClick=True",
  620. "Selectable=False",
  621. "UserMouse=False",
  622. "SupportsTransparentBackColor=True",
  623. "StandardDoubleClick=True",
  624. "AllPaintingInWmPaint=False",
  625. "CacheText=True",
  626. "EnableNotifyMessage=False",
  627. "DoubleBuffer=False"
  628. };
  629. Assert.AreEqual(TabPage_want, GetStyles(new TabPage()), "TabPageStyles");
  630. }
  631. [Test]
  632. public void HScrollBarStyleTest ()
  633. {
  634. string[] HScrollBar_want = {
  635. "ContainerControl=False",
  636. "UserPaint=False",
  637. "Opaque=False",
  638. "ResizeRedraw=False",
  639. "FixedWidth=False",
  640. "FixedHeight=False",
  641. "StandardClick=False",
  642. "Selectable=True",
  643. "UserMouse=False",
  644. "SupportsTransparentBackColor=False",
  645. "StandardDoubleClick=True",
  646. "AllPaintingInWmPaint=True",
  647. "CacheText=False",
  648. "EnableNotifyMessage=False",
  649. "DoubleBuffer=False"
  650. };
  651. Assert.AreEqual(HScrollBar_want, GetStyles(new HScrollBar()), "HScrollBarStyles");
  652. }
  653. [Test]
  654. public void VScrollBarStyleTest ()
  655. {
  656. string[] VScrollBar_want = {
  657. "ContainerControl=False",
  658. "UserPaint=False",
  659. "Opaque=False",
  660. "ResizeRedraw=False",
  661. "FixedWidth=False",
  662. "FixedHeight=False",
  663. "StandardClick=False",
  664. "Selectable=True",
  665. "UserMouse=False",
  666. "SupportsTransparentBackColor=False",
  667. "StandardDoubleClick=True",
  668. "AllPaintingInWmPaint=True",
  669. "CacheText=False",
  670. "EnableNotifyMessage=False",
  671. "DoubleBuffer=False"
  672. };
  673. Assert.AreEqual(VScrollBar_want, GetStyles(new VScrollBar()), "VScrollBarStyles");
  674. }
  675. [Test]
  676. public void SplitterStyleTest ()
  677. {
  678. string[] Splitter_want = {
  679. "ContainerControl=False",
  680. "UserPaint=True",
  681. "Opaque=False",
  682. "ResizeRedraw=False",
  683. "FixedWidth=False",
  684. "FixedHeight=False",
  685. "StandardClick=True",
  686. "Selectable=False",
  687. "UserMouse=False",
  688. "SupportsTransparentBackColor=False",
  689. "StandardDoubleClick=True",
  690. "AllPaintingInWmPaint=True",
  691. "CacheText=False",
  692. "EnableNotifyMessage=False",
  693. "DoubleBuffer=False"
  694. };
  695. Assert.AreEqual(Splitter_want, GetStyles(new Splitter()), "SplitterStyles");
  696. }
  697. [Test]
  698. public void StatusBarStyleTest ()
  699. {
  700. string[] StatusBar_want = {
  701. "ContainerControl=False",
  702. "UserPaint=False",
  703. "Opaque=False",
  704. "ResizeRedraw=False",
  705. "FixedWidth=False",
  706. "FixedHeight=False",
  707. "StandardClick=True",
  708. "Selectable=False",
  709. "UserMouse=False",
  710. "SupportsTransparentBackColor=False",
  711. "StandardDoubleClick=True",
  712. "AllPaintingInWmPaint=True",
  713. "CacheText=False",
  714. "EnableNotifyMessage=False",
  715. "DoubleBuffer=False"
  716. };
  717. Assert.AreEqual(StatusBar_want, GetStyles(new StatusBar()), "StatusBarStyles");
  718. }
  719. [Test]
  720. public void TabControlStyleTest ()
  721. {
  722. string[] TabControl_want = {
  723. "ContainerControl=False",
  724. "UserPaint=False",
  725. "Opaque=False",
  726. "ResizeRedraw=False",
  727. "FixedWidth=False",
  728. "FixedHeight=False",
  729. "StandardClick=True",
  730. "Selectable=True",
  731. "UserMouse=False",
  732. "SupportsTransparentBackColor=False",
  733. "StandardDoubleClick=True",
  734. "AllPaintingInWmPaint=True",
  735. "CacheText=False",
  736. "EnableNotifyMessage=False",
  737. "DoubleBuffer=False"
  738. };
  739. Assert.AreEqual(TabControl_want, GetStyles(new TabControl()), "TabControlStyles");
  740. }
  741. [Test]
  742. public void RichTextBoxStyleTest ()
  743. {
  744. string[] RichTextBox_want = {
  745. "ContainerControl=False",
  746. "UserPaint=False",
  747. "Opaque=False",
  748. "ResizeRedraw=False",
  749. "FixedWidth=False",
  750. "FixedHeight=False",
  751. "StandardClick=False",
  752. "Selectable=True",
  753. "UserMouse=False",
  754. "SupportsTransparentBackColor=False",
  755. "StandardDoubleClick=True",
  756. "AllPaintingInWmPaint=True",
  757. "CacheText=False",
  758. "EnableNotifyMessage=False",
  759. "DoubleBuffer=False"
  760. };
  761. Assert.AreEqual(RichTextBox_want, GetStyles(new RichTextBox()), "RichTextBoxStyles");
  762. }
  763. [Test]
  764. public void TextBoxStyleTest ()
  765. {
  766. string[] TextBox_want = {
  767. "ContainerControl=False",
  768. "UserPaint=False",
  769. "Opaque=False",
  770. "ResizeRedraw=False",
  771. "FixedWidth=False",
  772. "FixedHeight=True",
  773. "StandardClick=False",
  774. "Selectable=True",
  775. "UserMouse=False",
  776. "SupportsTransparentBackColor=False",
  777. "StandardDoubleClick=False",
  778. "AllPaintingInWmPaint=True",
  779. "CacheText=False",
  780. "EnableNotifyMessage=False",
  781. "DoubleBuffer=False"
  782. };
  783. Assert.AreEqual(TextBox_want, GetStyles(new TextBox()), "TextBoxStyles");
  784. }
  785. [Test]
  786. public void DataGridTextBoxStyleTest ()
  787. {
  788. string[] DataGridTextBox_want = {
  789. "ContainerControl=False",
  790. "UserPaint=False",
  791. "Opaque=False",
  792. "ResizeRedraw=False",
  793. "FixedWidth=False",
  794. "FixedHeight=True",
  795. "StandardClick=False",
  796. "Selectable=True",
  797. "UserMouse=False",
  798. "SupportsTransparentBackColor=False",
  799. "StandardDoubleClick=False",
  800. "AllPaintingInWmPaint=True",
  801. "CacheText=False",
  802. "EnableNotifyMessage=False",
  803. "DoubleBuffer=False"
  804. };
  805. Assert.AreEqual(DataGridTextBox_want, GetStyles(new DataGridTextBox()), "DataGridTextBoxStyles");
  806. }
  807. [Test]
  808. public void ToolBarStyleTest ()
  809. {
  810. string[] ToolBar_want = {
  811. "ContainerControl=False",
  812. "UserPaint=False",
  813. "Opaque=False",
  814. "ResizeRedraw=False",
  815. "FixedWidth=False",
  816. "FixedHeight=True",
  817. "StandardClick=True",
  818. "Selectable=True",
  819. "UserMouse=False",
  820. "SupportsTransparentBackColor=False",
  821. "StandardDoubleClick=True",
  822. "AllPaintingInWmPaint=True",
  823. "CacheText=False",
  824. "EnableNotifyMessage=False",
  825. "DoubleBuffer=False"
  826. };
  827. Assert.AreEqual(ToolBar_want, GetStyles(new ToolBar()), "ToolBarStyles");
  828. }
  829. [Test]
  830. public void TrackBarStyleTest ()
  831. {
  832. string[] TrackBar_want = {
  833. "ContainerControl=False",
  834. "UserPaint=False",
  835. "Opaque=False",
  836. "ResizeRedraw=False",
  837. "FixedWidth=False",
  838. "FixedHeight=False",
  839. "StandardClick=True",
  840. "Selectable=True",
  841. "UserMouse=False",
  842. "SupportsTransparentBackColor=False",
  843. "StandardDoubleClick=True",
  844. "AllPaintingInWmPaint=True",
  845. "CacheText=False",
  846. "EnableNotifyMessage=False",
  847. "DoubleBuffer=False"
  848. };
  849. Assert.AreEqual(TrackBar_want, GetStyles(new TrackBar()), "TrackBarStyles");
  850. }
  851. [Test]
  852. public void TreeViewStyleTest ()
  853. {
  854. string[] TreeView_want = {
  855. "ContainerControl=False",
  856. "UserPaint=False",
  857. "Opaque=False",
  858. "ResizeRedraw=False",
  859. "FixedWidth=False",
  860. "FixedHeight=False",
  861. "StandardClick=False",
  862. "Selectable=True",
  863. "UserMouse=False",
  864. "SupportsTransparentBackColor=False",
  865. "StandardDoubleClick=True",
  866. "AllPaintingInWmPaint=True",
  867. "CacheText=False",
  868. "EnableNotifyMessage=False",
  869. "DoubleBuffer=False"
  870. };
  871. Assert.AreEqual(TreeView_want, GetStyles(new TreeView()), "TreeViewStyles");
  872. }
  873. }
  874. }