ControlStyleTest.cs 22 KB

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