* roottypes.cs: Rename from tree.cs.
[mono.git] / mcs / class / System.Data / Test / System.Data.Tests.Mainsoft / System.Data / DataTableCollection / DataTableCollection_Item.cs
1 // Authors:
2 //   Rafael Mizrahi   <rafim@mainsoft.com>
3 //   Erez Lotan       <erezl@mainsoft.com>
4 //   Oren Gurfinkel   <oreng@mainsoft.com>
5 //   Ofer Borstein
6 // 
7 // Copyright (c) 2004 Mainsoft Co.
8 // 
9 // Permission is hereby granted, free of charge, to any person obtaining
10 // a copy of this software and associated documentation files (the
11 // "Software"), to deal in the Software without restriction, including
12 // without limitation the rights to use, copy, modify, merge, publish,
13 // distribute, sublicense, and/or sell copies of the Software, and to
14 // permit persons to whom the Software is furnished to do so, subject to
15 // the following conditions:
16 // 
17 // The above copyright notice and this permission notice shall be
18 // included in all copies or substantial portions of the Software.
19 // 
20 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
21 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
23 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
24 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
25 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
26 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27 //
28
29 using System;
30 using System.Data;
31 using NUnit.Framework;
32 using GHTUtils;
33 using GHTUtils.Base;
34
35 namespace tests.system_data_dll.System_Data
36 {
37
38 [TestFixture]
39 public class DataTableCollection_Item : GHTBase
40 {
41         public static void Main()
42         {
43                 DataTableCollection_Item tc = new DataTableCollection_Item();
44                 Exception exp = null;
45                 try
46                 {
47                         tc.BeginTest("DataTableCollection_Item");
48                         tc.run();
49                 }
50                 catch(Exception ex)
51                 {
52                         exp = ex;
53                 }
54                 finally
55                 {
56                         tc.EndTest(exp);
57                 }
58                 
59         }
60
61         //Activate This Construntor to log All To Standard output
62         //public TestClass():base(true){}
63
64         //Activate this constructor to log Failures to a log file
65         //public TestClass(System.IO.TextWriter tw):base(tw, false){}
66
67
68         //Activate this constructor to log All to a log file
69         //public TestClass(System.IO.TextWriter tw):base(tw, true){}
70
71         //BY DEFAULT LOGGING IS DONE TO THE STANDARD OUTPUT ONLY FOR FAILURES
72
73         public void run()
74         {
75                 Exception exp = null;
76                 try
77                 {
78                         BeginCase("DataTableCollection_Item");
79                         DataTableCollection_Item1();
80                 } 
81                 catch(Exception ex)
82                 {
83                         exp = ex;
84                 }
85                 finally
86                 {
87                         EndCase(exp);
88                         exp = null;
89                 }
90         }
91         [Test]
92         public void DataTableCollection_Item1()
93         {
94                 DataSet ds = new DataSet();
95                 DataTable dt = new DataTable("NewTable1");
96                 DataTable dt1 = new DataTable("NewTable2");
97                 ds.Tables.AddRange(new DataTable[] {dt,dt1});
98
99                 Compare(ds.Tables[0],dt);
100                 Compare(ds.Tables[1],dt1);
101                 Compare(ds.Tables["NewTable1"],dt);
102                 Compare(ds.Tables["NewTable2"],dt1);
103
104         }
105 }
106 }