DataRowCollectionTest.cs 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597
  1. // DataRowCollectionTest.cs - NUnit Test Cases for System.DataRowCollection
  2. //
  3. // Authors:
  4. // Franklin Wise ([email protected])
  5. // Martin Willemoes Hansen ([email protected])
  6. //
  7. // (C) Copyright 2002 Franklin Wise
  8. // (C) Copyright 2003 Martin Willemoes Hansen
  9. //
  10. using NUnit.Framework;
  11. using System;
  12. using System.Data;
  13. namespace MonoTests.System.Data
  14. {
  15. [TestFixture]
  16. public class DataRowCollectionTest : Assertion
  17. {
  18. private DataTable _tbl;
  19. [SetUp]
  20. public void GetReady()
  21. {
  22. _tbl = new DataTable();
  23. }
  24. [Test]
  25. public void AutoIncrement()
  26. {
  27. DataColumn col = new DataColumn("Auto");
  28. col.AutoIncrement = true;
  29. col.AutoIncrementSeed = 0;
  30. col.AutoIncrementStep = 1;
  31. _tbl.Columns.Add(col);
  32. _tbl.Rows.Add(_tbl.NewRow());
  33. AssertEquals("test#01" , 0, Convert.ToInt32(_tbl.Rows[0]["Auto"] ));
  34. _tbl.Rows.Add(_tbl.NewRow());
  35. AssertEquals("test#02" , 1, Convert.ToInt32(_tbl.Rows[1]["Auto"] ));
  36. col.AutoIncrement = false;
  37. AssertEquals("test#03" , 1, Convert.ToInt32(_tbl.Rows[1]["Auto"] ));
  38. _tbl.Rows.Add(_tbl.NewRow());
  39. AssertEquals("test#04" , DBNull.Value, _tbl.Rows[2]["Auto"]);
  40. col.AutoIncrement = true;
  41. col.AutoIncrementSeed = 10;
  42. col.AutoIncrementStep = 2;
  43. _tbl.Rows.Add(_tbl.NewRow());
  44. AssertEquals("test#05" , 10, Convert.ToInt32(_tbl.Rows[3]["Auto"] ));
  45. _tbl.Rows.Add(_tbl.NewRow());
  46. AssertEquals("test#06" , 12, Convert.ToInt32(_tbl.Rows[4]["Auto"] ));
  47. col = new DataColumn ("Auto2");
  48. col.DataType = typeof(string);
  49. col.AutoIncrement = true;
  50. col.AutoIncrementSeed = 0;
  51. col.AutoIncrementStep = 1;
  52. _tbl.Columns.Add (col);
  53. _tbl.Rows.Add(_tbl.NewRow());
  54. AssertEquals ("test#07", typeof (int), _tbl.Columns [1].DataType);
  55. AssertEquals ("test#08" , typeof (int), _tbl.Rows[5]["Auto2"].GetType ());
  56. col = new DataColumn ("Auto3");
  57. col.AutoIncrement = true;
  58. col.AutoIncrementSeed = 0;
  59. col.AutoIncrementStep = 1;
  60. col.DataType = typeof(string);
  61. AssertEquals ("test#09", typeof (string), col.DataType);
  62. AssertEquals ("test#10", false, col.AutoIncrement);
  63. }
  64. [Test]
  65. public void Add ()
  66. {
  67. _tbl.Columns.Add ();
  68. _tbl.Columns.Add ();
  69. DataRow Row = _tbl.NewRow ();
  70. DataRowCollection Rows = _tbl.Rows;
  71. Rows.Add (Row);
  72. AssertEquals ("test#01", 1, Rows.Count);
  73. AssertEquals ("test#02", false, Rows.IsReadOnly);
  74. AssertEquals ("test#03", false, Rows.IsSynchronized);
  75. AssertEquals ("test#04", "System.Data.DataRowCollection", Rows.ToString ());
  76. string [] cols = new string [2];
  77. cols [0] = "first";
  78. cols [1] = "second";
  79. Rows.Add (cols);
  80. cols [0] = "something";
  81. cols [1] = "else";
  82. Rows.Add (cols);
  83. AssertEquals ("test#05", 3, Rows.Count);
  84. AssertEquals ("test#06", "System.Data.DataRow", Rows [0].ToString ());
  85. AssertEquals ("test#07", DBNull.Value, Rows [0] [0]);
  86. AssertEquals ("test#08", DBNull.Value, Rows [0] [1]);
  87. AssertEquals ("test#09", "first", Rows [1] [0]);
  88. AssertEquals ("test#10", "something", Rows [2] [0]);
  89. AssertEquals ("test#11", "second", Rows [1] [1]);
  90. AssertEquals ("test#12", "else", Rows [2] [1]);
  91. try {
  92. Rows.Add (Row);
  93. Fail ("test#13");
  94. } catch (Exception e) {
  95. AssertEquals ("test#14", typeof (ArgumentException), e.GetType ());
  96. AssertEquals ("test#15", "This row already belongs to this table.", e.Message);
  97. }
  98. try {
  99. Row = null;
  100. Rows.Add (Row);
  101. Fail ("test#16");
  102. } catch (Exception e) {
  103. AssertEquals ("test#17", typeof (ArgumentNullException), e.GetType ());
  104. //AssertEquals ("test#18", "'row' argument cannot be null.\r\nParameter name: row", e.Message);
  105. }
  106. DataColumn Column = new DataColumn ("not_null");
  107. Column.AllowDBNull = false;
  108. _tbl.Columns.Add (Column);
  109. cols = new string [3];
  110. cols [0] = "first";
  111. cols [1] = "second";
  112. cols [2] = null;
  113. try {
  114. Rows.Add (cols);
  115. Fail ("test#19");
  116. } catch (Exception e) {
  117. AssertEquals ("test#20", typeof (NoNullAllowedException), e.GetType ());
  118. //AssertEquals ("test#21", "Column 'not_null' does not allow nulls.", e.Message);
  119. }
  120. Column = _tbl.Columns [0];
  121. Column.Unique = true;
  122. cols = new string [3];
  123. cols [0] = "first";
  124. cols [1] = "second";
  125. cols [2] = "blabal";
  126. try {
  127. Rows.Add (cols);
  128. Fail ("test#22");
  129. } catch (Exception e) {
  130. AssertEquals ("test#23", typeof (ConstraintException), e.GetType ());
  131. AssertEquals ("test#24", "Column 'Column1' is constrained to be unique. Value 'first' is already present.", e.Message);
  132. }
  133. Column = new DataColumn ("integer");
  134. Column.DataType = typeof (short);
  135. _tbl.Columns.Add (Column);
  136. object [] obs = new object [4];
  137. obs [0] = "_first";
  138. obs [1] = "second";
  139. obs [2] = "blabal";
  140. obs [3] = "ads";
  141. try {
  142. Rows.Add (obs);
  143. Fail ("test#25");
  144. } catch (Exception e) {
  145. // LAMESPEC: MSDN says this exception is InvalidCastException
  146. AssertEquals ("test#26", typeof (ArgumentException), e.GetType ());
  147. }
  148. }
  149. [Test]
  150. public void Clear ()
  151. {
  152. DataRowCollection Rows = _tbl.Rows;
  153. DataTable Table = new DataTable ("child");
  154. Table.Columns.Add ("first", typeof (int));
  155. Table.Columns.Add ("second", typeof (string));
  156. _tbl.Columns.Add ("first", typeof (int));
  157. _tbl.Columns.Add ("second", typeof (float));
  158. string [] cols = new string [2];
  159. cols [0] = "1";
  160. cols [1] = "1,1";
  161. Rows.Add (cols);
  162. cols [0] = "2";
  163. cols [1] = "2,1";
  164. Rows.Add (cols);
  165. cols [0] = "3";
  166. cols [1] = "3,1";
  167. Rows.Add (cols);
  168. AssertEquals ("test#01", 3, Rows.Count);
  169. Rows.Clear ();
  170. // hmm... TODO: better tests
  171. AssertEquals ("test#02", 0, Rows.Count);
  172. cols [0] = "1";
  173. cols [1] = "1,1";
  174. Rows.Add (cols);
  175. cols [0] = "2";
  176. cols [1] = "2,1";
  177. Rows.Add (cols);
  178. cols [0] = "3";
  179. cols [1] = "3,1";
  180. Rows.Add (cols);
  181. cols [0] = "1";
  182. cols [1] = "test";
  183. Table.Rows.Add (cols);
  184. cols [0] = "2";
  185. cols [1] = "test2";
  186. Table.Rows.Add (cols);
  187. cols [0] = "3";
  188. cols [1] = "test3";
  189. Table.Rows.Add (cols);
  190. DataRelation Rel = new DataRelation ("REL", _tbl.Columns [0], Table.Columns [0]);
  191. DataSet Set = new DataSet ();
  192. Set.Tables.Add (_tbl);
  193. Set.Tables.Add (Table);
  194. Set.Relations.Add (Rel);
  195. try {
  196. Rows.Clear ();
  197. Fail ("test#03");
  198. } catch (Exception e) {
  199. AssertEquals ("test#04", typeof (InvalidConstraintException), e.GetType ());
  200. AssertEquals ("test#05", "Cannot clear table Table1 because ForeignKeyConstraint REL enforces constraints and there are child rows in child.", e.Message);
  201. }
  202. AssertEquals ("test#06", 3, Table.Rows.Count);
  203. Table.Rows.Clear ();
  204. AssertEquals ("test#07", 0, Table.Rows.Count);
  205. }
  206. [Test]
  207. public void Contains ()
  208. {
  209. DataColumn C = new DataColumn ("key");
  210. C.Unique = true;
  211. C.DataType = typeof (int);
  212. C.AutoIncrement = true;
  213. C.AutoIncrementSeed = 0;
  214. C.AutoIncrementStep = 1;
  215. _tbl.Columns.Add (C);
  216. _tbl.Columns.Add ("first", typeof (string));
  217. _tbl.Columns.Add ("second", typeof (decimal));
  218. DataRowCollection Rows = _tbl.Rows;
  219. DataRow Row = _tbl.NewRow ();
  220. _tbl.Rows.Add (Row);
  221. Row = _tbl.NewRow ();
  222. _tbl.Rows.Add (Row);
  223. Row = _tbl.NewRow ();
  224. _tbl.Rows.Add (Row);
  225. Row = _tbl.NewRow ();
  226. _tbl.Rows.Add (Row);
  227. Rows [0] [1] = "test0";
  228. Rows [0] [2] = 0;
  229. Rows [1] [1] = "test1";
  230. Rows [1] [2] = 1;
  231. Rows [2] [1] = "test2";
  232. Rows [2] [2] = 2;
  233. Rows [3] [1] = "test3";
  234. Rows [3] [2] = 3;
  235. AssertEquals ("test#01", 3, _tbl.Columns.Count);
  236. AssertEquals ("test#02", 4, _tbl.Rows.Count);
  237. AssertEquals ("test#03", 0, _tbl.Rows [0] [0]);
  238. AssertEquals ("test#04", 1, _tbl.Rows [1] [0]);
  239. AssertEquals ("test#05", 2, _tbl.Rows [2] [0]);
  240. AssertEquals ("test#06", 3, _tbl.Rows [3] [0]);
  241. try {
  242. Rows.Contains (1);
  243. Fail ("test#07");
  244. } catch (Exception e) {
  245. AssertEquals ("test#08", typeof (MissingPrimaryKeyException), e.GetType ());
  246. AssertEquals ("test#09", "Table doesn't have a primary key.", e.Message);
  247. }
  248. _tbl.PrimaryKey = new DataColumn [] {_tbl.Columns [0]};
  249. AssertEquals ("test#10", true, Rows.Contains (1));
  250. AssertEquals ("test#11", true, Rows.Contains (2));
  251. AssertEquals ("test#12", false, Rows.Contains (4));
  252. try {
  253. Rows.Contains (new object [] {64, "test0"});
  254. Fail ("test#13");
  255. } catch (Exception e) {
  256. AssertEquals ("test#14", typeof (ArgumentException), e.GetType ());
  257. AssertEquals ("test#15", "Expecting 1 value(s) for the key being indexed, but received 2 value(s).", e.Message);
  258. }
  259. _tbl.PrimaryKey = new DataColumn [] {_tbl.Columns [0], _tbl.Columns [1]};
  260. AssertEquals ("test#16", false, Rows.Contains (new object [] {64, "test0"}));
  261. AssertEquals ("test#17", false, Rows.Contains (new object [] {0, "test1"}));
  262. AssertEquals ("test#18", true, Rows.Contains (new object [] {1, "test1"}));
  263. AssertEquals ("test#19", true, Rows.Contains (new object [] {2, "test2"}));
  264. try {
  265. Rows.Contains (new object [] {2});
  266. Fail ("test#20");
  267. } catch (Exception e) {
  268. AssertEquals ("test#21", typeof (ArgumentException), e.GetType ());
  269. AssertEquals ("test#22", "Expecting 2 value(s) for the key being indexed, but received 1 value(s).", e.Message);
  270. }
  271. }
  272. [Test]
  273. public void CopyTo ()
  274. {
  275. _tbl.Columns.Add ();
  276. _tbl.Columns.Add ();
  277. _tbl.Columns.Add ();
  278. DataRowCollection Rows = _tbl.Rows;
  279. Rows.Add (new object [] {"1", "1", "1"});
  280. Rows.Add (new object [] {"2", "2", "2"});
  281. Rows.Add (new object [] {"3", "3", "3"});
  282. Rows.Add (new object [] {"4", "4", "4"});
  283. Rows.Add (new object [] {"5", "5", "5"});
  284. Rows.Add (new object [] {"6", "6", "6"});
  285. Rows.Add (new object [] {"7", "7", "7"});
  286. DataRow [] dr = new DataRow [10];
  287. try {
  288. Rows.CopyTo (dr, 4);
  289. Fail ("test#01");
  290. } catch (Exception e) {
  291. AssertEquals ("test#02", typeof (ArgumentException), e.GetType ());
  292. //AssertEquals ("test#03", "Destination array was not long enough. Check destIndex and length, and the array's lower bounds.", e.Message);
  293. }
  294. dr = new DataRow [11];
  295. Rows.CopyTo (dr, 4);
  296. AssertEquals ("test#04", null, dr [0]);
  297. AssertEquals ("test#05", null, dr [1]);
  298. AssertEquals ("test#06", null, dr [2]);
  299. AssertEquals ("test#07", null, dr [3]);
  300. AssertEquals ("test#08", "1", dr [4] [0]);
  301. AssertEquals ("test#09", "2", dr [5] [0]);
  302. AssertEquals ("test#10", "3", dr [6] [0]);
  303. AssertEquals ("test#11", "4", dr [7] [0]);
  304. AssertEquals ("test#12", "5", dr [8] [0]);
  305. AssertEquals ("test#13", "6", dr [9] [0]);
  306. }
  307. [Test]
  308. public void Equals ()
  309. {
  310. _tbl.Columns.Add ();
  311. _tbl.Columns.Add ();
  312. _tbl.Columns.Add ();
  313. DataRowCollection Rows1 = _tbl.Rows;
  314. Rows1.Add (new object [] {"1", "1", "1"});
  315. Rows1.Add (new object [] {"2", "2", "2"});
  316. Rows1.Add (new object [] {"3", "3", "3"});
  317. Rows1.Add (new object [] {"4", "4", "4"});
  318. Rows1.Add (new object [] {"5", "5", "5"});
  319. Rows1.Add (new object [] {"6", "6", "6"});
  320. Rows1.Add (new object [] {"7", "7", "7"});
  321. DataRowCollection Rows2 = _tbl.Rows;
  322. AssertEquals ("test#01", true, Rows2.Equals (Rows1));
  323. AssertEquals ("test#02", true, Rows1.Equals (Rows2));
  324. AssertEquals ("test#03", true, Rows1.Equals (Rows1));
  325. DataTable Table = new DataTable ();
  326. Table.Columns.Add ();
  327. Table.Columns.Add ();
  328. Table.Columns.Add ();
  329. DataRowCollection Rows3 = Table.Rows;
  330. Rows3.Add (new object [] {"1", "1", "1"});
  331. Rows3.Add (new object [] {"2", "2", "2"});
  332. Rows3.Add (new object [] {"3", "3", "3"});
  333. Rows3.Add (new object [] {"4", "4", "4"});
  334. Rows3.Add (new object [] {"5", "5", "5"});
  335. Rows3.Add (new object [] {"6", "6", "6"});
  336. Rows3.Add (new object [] {"7", "7", "7"});
  337. AssertEquals ("test#04", false, Rows3.Equals (Rows1));
  338. AssertEquals ("test#05", false, Rows3.Equals (Rows2));
  339. AssertEquals ("test#06", false, Rows1.Equals (Rows3));
  340. AssertEquals ("test#07", false, Rows2.Equals (Rows3));
  341. }
  342. [Test]
  343. public void Find ()
  344. {
  345. DataColumn Col = new DataColumn ("test_1");
  346. Col.AllowDBNull = false;
  347. Col.Unique = true;
  348. Col.DataType = typeof (long);
  349. _tbl.Columns.Add (Col);
  350. Col = new DataColumn ("test_2");
  351. Col.DataType = typeof (string);
  352. _tbl.Columns.Add (Col);
  353. DataRowCollection Rows = _tbl.Rows;
  354. Rows.Add (new object [] {1, "first"});
  355. Rows.Add (new object [] {2, "second"});
  356. Rows.Add (new object [] {3, "third"});
  357. Rows.Add (new object [] {4, "fourth"});
  358. Rows.Add (new object [] {5, "fifth"});
  359. try {
  360. Rows.Find (1);
  361. Fail ("test#01");
  362. } catch (Exception e) {
  363. AssertEquals ("test#02", typeof (MissingPrimaryKeyException), e.GetType ());
  364. AssertEquals ("test#03", "Table doesn't have a primary key.", e.Message);
  365. }
  366. _tbl.PrimaryKey = new DataColumn [] {_tbl.Columns [0]};
  367. DataRow row = Rows.Find (1);
  368. AssertEquals ("test#04", 1L, row [0]);
  369. row = Rows.Find (2);
  370. AssertEquals ("test#05", 2L, row [0]);
  371. row = Rows.Find ("2");
  372. AssertEquals ("test#06", 2L, row [0]);
  373. try {
  374. row = Rows.Find ("test");
  375. Fail ("test#07");
  376. } catch (Exception e) {
  377. AssertEquals ("test#08", typeof (FormatException), e.GetType ());
  378. //AssertEquals ("test#09", "Input string was not in a correct format.", e.Message);
  379. }
  380. String tes = null;
  381. row = Rows.Find (tes);
  382. AssertEquals ("test#10", null, row);
  383. _tbl.PrimaryKey = null;
  384. try {
  385. Rows.Find (new object [] {1, "fir"});
  386. Fail ("test#11");
  387. } catch (Exception e) {
  388. AssertEquals ("test#12", typeof (MissingPrimaryKeyException), e.GetType ());
  389. AssertEquals ("tets#13", "Table doesn't have a primary key.", e.Message);
  390. }
  391. _tbl.PrimaryKey = new DataColumn [] {_tbl.Columns [0], _tbl.Columns [1]};
  392. try {
  393. Rows.Find (1);
  394. Fail ("test#14");
  395. } catch (Exception e) {
  396. AssertEquals ("test#15", typeof (ArgumentException), e.GetType ());
  397. AssertEquals ("test#16", "Expecting 2 value(s) for the key being indexed, but received 1 value(s).", e.Message);
  398. }
  399. row = Rows.Find (new object [] {1, "fir"});
  400. AssertEquals ("test#16", null, row);
  401. row = Rows.Find (new object [] {1, "first"});
  402. AssertEquals ("test#17", 1L, row [0]);
  403. }
  404. [Test]
  405. public void InsertAt ()
  406. {
  407. _tbl.Columns.Add ();
  408. _tbl.Columns.Add ();
  409. _tbl.Columns.Add ();
  410. DataRowCollection Rows = _tbl.Rows;
  411. Rows.Add (new object [] {"a", "aa", "aaa"});
  412. Rows.Add (new object [] {"b", "bb", "bbb"});
  413. Rows.Add (new object [] {"c", "cc", "ccc"});
  414. Rows.Add (new object [] {"d", "dd", "ddd"});
  415. DataRow Row = _tbl.NewRow ();
  416. Row [0] = "e";
  417. Row [1] = "ee";
  418. Row [2] = "eee";
  419. try {
  420. Rows.InsertAt (Row, -1);
  421. Fail ("test#01");
  422. } catch (Exception e) {
  423. AssertEquals ("test#02", typeof (IndexOutOfRangeException), e.GetType ());
  424. AssertEquals ("test#03", "The row insert position -1 is invalid.", e.Message);
  425. }
  426. Rows.InsertAt (Row, 0);
  427. AssertEquals ("test#04", "e", Rows [0][0]);
  428. AssertEquals ("test#05", "a", Rows [1][0]);
  429. Row = _tbl.NewRow ();
  430. Row [0] = "f";
  431. Row [1] = "ff";
  432. Row [2] = "fff";
  433. Rows.InsertAt (Row, 5);
  434. AssertEquals ("test#06", "f", Rows [5][0]);
  435. Row = _tbl.NewRow ();
  436. Row [0] = "g";
  437. Row [1] = "gg";
  438. Row [2] = "ggg";
  439. Rows.InsertAt (Row, 500);
  440. AssertEquals ("test#07", "g", Rows [6][0]);
  441. }
  442. [Test]
  443. public void Remove ()
  444. {
  445. _tbl.Columns.Add ();
  446. _tbl.Columns.Add ();
  447. _tbl.Columns.Add ();
  448. DataRowCollection Rows = _tbl.Rows;
  449. Rows.Add (new object [] {"a", "aa", "aaa"});
  450. Rows.Add (new object [] {"b", "bb", "bbb"});
  451. Rows.Add (new object [] {"c", "cc", "ccc"});
  452. Rows.Add (new object [] {"d", "dd", "ddd"});
  453. AssertEquals ("test#01", 4, _tbl.Rows.Count);
  454. Rows.Remove (_tbl.Rows [1]);
  455. AssertEquals ("test#02", 3, _tbl.Rows.Count);
  456. AssertEquals ("test#03", "a", _tbl.Rows [0] [0]);
  457. AssertEquals ("test#04", "c", _tbl.Rows [1] [0]);
  458. AssertEquals ("test#05", "d", _tbl.Rows [2] [0]);
  459. try {
  460. Rows.Remove (null);
  461. Fail ("test#06");
  462. } catch (Exception e) {
  463. AssertEquals ("test#07", typeof (IndexOutOfRangeException), e.GetType ());
  464. AssertEquals ("test#08", "The given datarow is not in the current DataRowCollection.", e.Message);
  465. }
  466. DataRow Row = new DataTable ().NewRow ();
  467. try {
  468. Rows.Remove (Row);
  469. Fail ("test#09");
  470. } catch (Exception e) {
  471. AssertEquals ("test#10", typeof (IndexOutOfRangeException), e.GetType ());
  472. AssertEquals ("test#11", "The given datarow is not in the current DataRowCollection.", e.Message);
  473. }
  474. try {
  475. Rows.RemoveAt (-1);
  476. Fail ("test#12");
  477. } catch (Exception e) {
  478. AssertEquals ("test#13", typeof (IndexOutOfRangeException), e.GetType ());
  479. AssertEquals ("test#14", "There is no row at position -1.", e.Message);
  480. }
  481. try {
  482. Rows.RemoveAt (64);
  483. Fail ("test#15");
  484. } catch (Exception e) {
  485. AssertEquals ("test#16", typeof (IndexOutOfRangeException), e.GetType ());
  486. AssertEquals ("test#17", "There is no row at position 64.", e.Message);
  487. }
  488. Rows.RemoveAt (0);
  489. Rows.RemoveAt (1);
  490. AssertEquals ("test#18", 1, Rows.Count);
  491. AssertEquals ("test#19", "c", Rows [0] [0]);
  492. }
  493. }
  494. }