ControlStyleTest.cs 23 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001
  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. Form f = new Form ();
  498. f.ShowInTaskbar = false;
  499. Assert.AreEqual(Form_want, GetStyles(f), "FormStyles");
  500. f.Dispose ();
  501. }
  502. [Test]
  503. public void PropertyGridStyleTest ()
  504. {
  505. string[] PropertyGrid_want = {
  506. "ContainerControl=True",
  507. "UserPaint=True",
  508. "Opaque=False",
  509. "ResizeRedraw=False",
  510. "FixedWidth=False",
  511. "FixedHeight=False",
  512. "StandardClick=True",
  513. "Selectable=True",
  514. "UserMouse=False",
  515. "SupportsTransparentBackColor=False",
  516. "StandardDoubleClick=True",
  517. "AllPaintingInWmPaint=False",
  518. "CacheText=False",
  519. "EnableNotifyMessage=False",
  520. "DoubleBuffer=False"
  521. };
  522. Assert.AreEqual(PropertyGrid_want, GetStyles(new PropertyGrid()), "PropertyGridStyles");
  523. }
  524. [Test]
  525. public void DomainUpDownStyleTest ()
  526. {
  527. string[] DomainUpDown_want = {
  528. "ContainerControl=True",
  529. "UserPaint=True",
  530. "Opaque=False",
  531. "ResizeRedraw=False",
  532. "FixedWidth=False",
  533. "FixedHeight=True",
  534. "StandardClick=True",
  535. "Selectable=True",
  536. "UserMouse=False",
  537. "SupportsTransparentBackColor=False",
  538. "StandardDoubleClick=True",
  539. "AllPaintingInWmPaint=False",
  540. "CacheText=False",
  541. "EnableNotifyMessage=False",
  542. "DoubleBuffer=False"
  543. };
  544. Assert.AreEqual(DomainUpDown_want, GetStyles(new DomainUpDown()), "DomainUpDownStyles");
  545. }
  546. [Test]
  547. public void NumericUpDownStyleTest ()
  548. {
  549. string[] NumericUpDown_want = {
  550. "ContainerControl=True",
  551. "UserPaint=True",
  552. "Opaque=False",
  553. "ResizeRedraw=False",
  554. "FixedWidth=False",
  555. "FixedHeight=True",
  556. "StandardClick=True",
  557. "Selectable=True",
  558. "UserMouse=False",
  559. "SupportsTransparentBackColor=False",
  560. "StandardDoubleClick=True",
  561. "AllPaintingInWmPaint=False",
  562. "CacheText=False",
  563. "EnableNotifyMessage=False",
  564. "DoubleBuffer=False"
  565. };
  566. Assert.AreEqual(NumericUpDown_want, GetStyles(new NumericUpDown()), "NumericUpDownStyles");
  567. }
  568. [Test]
  569. public void UserControlStyleTest ()
  570. {
  571. string[] UserControl_want = {
  572. "ContainerControl=True",
  573. "UserPaint=True",
  574. "Opaque=False",
  575. "ResizeRedraw=False",
  576. "FixedWidth=False",
  577. "FixedHeight=False",
  578. "StandardClick=True",
  579. "Selectable=True",
  580. "UserMouse=False",
  581. "SupportsTransparentBackColor=False",
  582. "StandardDoubleClick=True",
  583. "AllPaintingInWmPaint=False",
  584. "CacheText=False",
  585. "EnableNotifyMessage=False",
  586. "DoubleBuffer=False"
  587. };
  588. Assert.AreEqual(UserControl_want, GetStyles(new UserControl()), "UserControlStyles");
  589. }
  590. [Test]
  591. public void PanelStyleTest ()
  592. {
  593. string[] Panel_want = {
  594. "ContainerControl=True",
  595. "UserPaint=True",
  596. "Opaque=False",
  597. "ResizeRedraw=False",
  598. "FixedWidth=False",
  599. "FixedHeight=False",
  600. "StandardClick=True",
  601. "Selectable=False",
  602. "UserMouse=False",
  603. "SupportsTransparentBackColor=True",
  604. "StandardDoubleClick=True",
  605. "AllPaintingInWmPaint=False",
  606. "CacheText=False",
  607. "EnableNotifyMessage=False",
  608. "DoubleBuffer=False"
  609. };
  610. Assert.AreEqual(Panel_want, GetStyles(new Panel()), "PanelStyles");
  611. }
  612. [Test]
  613. public void TabPageStyleTest ()
  614. {
  615. string[] TabPage_want = {
  616. "ContainerControl=True",
  617. "UserPaint=True",
  618. "Opaque=False",
  619. "ResizeRedraw=False",
  620. "FixedWidth=False",
  621. "FixedHeight=False",
  622. "StandardClick=True",
  623. "Selectable=False",
  624. "UserMouse=False",
  625. "SupportsTransparentBackColor=True",
  626. "StandardDoubleClick=True",
  627. "AllPaintingInWmPaint=False",
  628. "CacheText=True",
  629. "EnableNotifyMessage=False",
  630. "DoubleBuffer=False"
  631. };
  632. Assert.AreEqual(TabPage_want, GetStyles(new TabPage()), "TabPageStyles");
  633. }
  634. [Test]
  635. public void HScrollBarStyleTest ()
  636. {
  637. string[] HScrollBar_want = {
  638. "ContainerControl=False",
  639. "UserPaint=False",
  640. "Opaque=False",
  641. "ResizeRedraw=False",
  642. "FixedWidth=False",
  643. "FixedHeight=False",
  644. "StandardClick=False",
  645. "Selectable=True",
  646. "UserMouse=False",
  647. "SupportsTransparentBackColor=False",
  648. "StandardDoubleClick=True",
  649. "AllPaintingInWmPaint=True",
  650. "CacheText=False",
  651. "EnableNotifyMessage=False",
  652. "DoubleBuffer=False"
  653. };
  654. Assert.AreEqual(HScrollBar_want, GetStyles(new HScrollBar()), "HScrollBarStyles");
  655. }
  656. [Test]
  657. public void VScrollBarStyleTest ()
  658. {
  659. string[] VScrollBar_want = {
  660. "ContainerControl=False",
  661. "UserPaint=False",
  662. "Opaque=False",
  663. "ResizeRedraw=False",
  664. "FixedWidth=False",
  665. "FixedHeight=False",
  666. "StandardClick=False",
  667. "Selectable=True",
  668. "UserMouse=False",
  669. "SupportsTransparentBackColor=False",
  670. "StandardDoubleClick=True",
  671. "AllPaintingInWmPaint=True",
  672. "CacheText=False",
  673. "EnableNotifyMessage=False",
  674. "DoubleBuffer=False"
  675. };
  676. Assert.AreEqual(VScrollBar_want, GetStyles(new VScrollBar()), "VScrollBarStyles");
  677. }
  678. [Test]
  679. public void SplitterStyleTest ()
  680. {
  681. string[] Splitter_want = {
  682. "ContainerControl=False",
  683. "UserPaint=True",
  684. "Opaque=False",
  685. "ResizeRedraw=False",
  686. "FixedWidth=False",
  687. "FixedHeight=False",
  688. "StandardClick=True",
  689. "Selectable=False",
  690. "UserMouse=False",
  691. "SupportsTransparentBackColor=False",
  692. "StandardDoubleClick=True",
  693. "AllPaintingInWmPaint=True",
  694. "CacheText=False",
  695. "EnableNotifyMessage=False",
  696. "DoubleBuffer=False"
  697. };
  698. Assert.AreEqual(Splitter_want, GetStyles(new Splitter()), "SplitterStyles");
  699. }
  700. [Test]
  701. public void StatusBarStyleTest ()
  702. {
  703. string[] StatusBar_want = {
  704. "ContainerControl=False",
  705. "UserPaint=False",
  706. "Opaque=False",
  707. "ResizeRedraw=False",
  708. "FixedWidth=False",
  709. "FixedHeight=False",
  710. "StandardClick=True",
  711. "Selectable=False",
  712. "UserMouse=False",
  713. "SupportsTransparentBackColor=False",
  714. "StandardDoubleClick=True",
  715. "AllPaintingInWmPaint=True",
  716. "CacheText=False",
  717. "EnableNotifyMessage=False",
  718. "DoubleBuffer=False"
  719. };
  720. Assert.AreEqual(StatusBar_want, GetStyles(new StatusBar()), "StatusBarStyles");
  721. }
  722. [Test]
  723. public void TabControlStyleTest ()
  724. {
  725. string[] TabControl_want = {
  726. "ContainerControl=False",
  727. "UserPaint=False",
  728. "Opaque=False",
  729. "ResizeRedraw=False",
  730. "FixedWidth=False",
  731. "FixedHeight=False",
  732. "StandardClick=True",
  733. "Selectable=True",
  734. "UserMouse=False",
  735. "SupportsTransparentBackColor=False",
  736. "StandardDoubleClick=True",
  737. "AllPaintingInWmPaint=True",
  738. "CacheText=False",
  739. "EnableNotifyMessage=False",
  740. "DoubleBuffer=False"
  741. };
  742. Assert.AreEqual(TabControl_want, GetStyles(new TabControl()), "TabControlStyles");
  743. }
  744. [Test]
  745. public void RichTextBoxStyleTest ()
  746. {
  747. string[] RichTextBox_want = {
  748. "ContainerControl=False",
  749. "UserPaint=False",
  750. "Opaque=False",
  751. "ResizeRedraw=False",
  752. "FixedWidth=False",
  753. "FixedHeight=False",
  754. "StandardClick=False",
  755. "Selectable=True",
  756. "UserMouse=False",
  757. "SupportsTransparentBackColor=False",
  758. "StandardDoubleClick=True",
  759. "AllPaintingInWmPaint=True",
  760. "CacheText=False",
  761. "EnableNotifyMessage=False",
  762. "DoubleBuffer=False"
  763. };
  764. Assert.AreEqual(RichTextBox_want, GetStyles(new RichTextBox()), "RichTextBoxStyles");
  765. }
  766. [Test]
  767. public void TextBoxStyleTest ()
  768. {
  769. string[] TextBox_want = {
  770. "ContainerControl=False",
  771. "UserPaint=False",
  772. "Opaque=False",
  773. "ResizeRedraw=False",
  774. "FixedWidth=False",
  775. "FixedHeight=True",
  776. "StandardClick=False",
  777. "Selectable=True",
  778. "UserMouse=False",
  779. "SupportsTransparentBackColor=False",
  780. "StandardDoubleClick=False",
  781. "AllPaintingInWmPaint=True",
  782. "CacheText=False",
  783. "EnableNotifyMessage=False",
  784. "DoubleBuffer=False"
  785. };
  786. Assert.AreEqual(TextBox_want, GetStyles(new TextBox()), "TextBoxStyles");
  787. }
  788. [Test]
  789. public void DataGridTextBoxStyleTest ()
  790. {
  791. string[] DataGridTextBox_want = {
  792. "ContainerControl=False",
  793. "UserPaint=False",
  794. "Opaque=False",
  795. "ResizeRedraw=False",
  796. "FixedWidth=False",
  797. "FixedHeight=True",
  798. "StandardClick=False",
  799. "Selectable=True",
  800. "UserMouse=False",
  801. "SupportsTransparentBackColor=False",
  802. "StandardDoubleClick=False",
  803. "AllPaintingInWmPaint=True",
  804. "CacheText=False",
  805. "EnableNotifyMessage=False",
  806. "DoubleBuffer=False"
  807. };
  808. Assert.AreEqual(DataGridTextBox_want, GetStyles(new DataGridTextBox()), "DataGridTextBoxStyles");
  809. }
  810. [Test]
  811. public void ToolBarStyleTest ()
  812. {
  813. string[] ToolBar_want = {
  814. "ContainerControl=False",
  815. "UserPaint=False",
  816. "Opaque=False",
  817. "ResizeRedraw=False",
  818. "FixedWidth=False",
  819. "FixedHeight=True",
  820. "StandardClick=True",
  821. "Selectable=True",
  822. "UserMouse=False",
  823. "SupportsTransparentBackColor=False",
  824. "StandardDoubleClick=True",
  825. "AllPaintingInWmPaint=True",
  826. "CacheText=False",
  827. "EnableNotifyMessage=False",
  828. "DoubleBuffer=False"
  829. };
  830. Assert.AreEqual(ToolBar_want, GetStyles(new ToolBar()), "ToolBarStyles");
  831. }
  832. [Test]
  833. public void TrackBarStyleTest ()
  834. {
  835. string[] TrackBar_want = {
  836. "ContainerControl=False",
  837. "UserPaint=False",
  838. "Opaque=False",
  839. "ResizeRedraw=False",
  840. "FixedWidth=False",
  841. "FixedHeight=False",
  842. "StandardClick=True",
  843. "Selectable=True",
  844. "UserMouse=False",
  845. "SupportsTransparentBackColor=False",
  846. "StandardDoubleClick=True",
  847. "AllPaintingInWmPaint=True",
  848. "CacheText=False",
  849. "EnableNotifyMessage=False",
  850. "DoubleBuffer=False"
  851. };
  852. Assert.AreEqual(TrackBar_want, GetStyles(new TrackBar()), "TrackBarStyles");
  853. }
  854. [Test]
  855. public void TreeViewStyleTest ()
  856. {
  857. string[] TreeView_want = {
  858. "ContainerControl=False",
  859. "UserPaint=False",
  860. "Opaque=False",
  861. "ResizeRedraw=False",
  862. "FixedWidth=False",
  863. "FixedHeight=False",
  864. "StandardClick=False",
  865. "Selectable=True",
  866. "UserMouse=False",
  867. "SupportsTransparentBackColor=False",
  868. "StandardDoubleClick=True",
  869. "AllPaintingInWmPaint=True",
  870. "CacheText=False",
  871. "EnableNotifyMessage=False",
  872. "DoubleBuffer=False"
  873. };
  874. Assert.AreEqual(TreeView_want, GetStyles(new TreeView()), "TreeViewStyles");
  875. }
  876. }
  877. }