error messages review
[mono.git] / mcs / class / System.Data / Test / System.Data.Tests.Mainsoft / System.Data / DataColumnCollection / DataColumnCollection_IndexOf_S.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 NUnit.Framework;
30 using System;
31 using System.Data;
32
33 using GHTUtils;
34 using GHTUtils.Base;
35
36 namespace tests.system_data_dll.System_Data
37 {
38 [TestFixture]
39 public class DataColumnCollection_IndexOf_S : GHTBase
40 {
41         [Test]
42         [Category ("NotWorking")] 
43         public void Main()
44         {
45                 DataColumnCollection_IndexOf_S tc = new DataColumnCollection_IndexOf_S();
46                 Exception exp = null;
47                 try
48                 {
49                         tc.BeginTest("DataColumnCollection_IndexOf_S");
50                         tc.run();
51                 }
52                 catch(Exception ex)
53                 {
54                         exp = ex;
55                 }
56                 finally
57                 {
58                         tc.EndTest(exp);
59                 }
60                 
61         }
62
63         //Activate This Construntor to log All To Standard output
64         //public TestClass():base(true){}
65
66         //Activate this constructor to log Failures to a log file
67         //public TestClass(System.IO.TextWriter tw):base(tw, false){}
68
69
70         //Activate this constructor to log All to a log file
71         //public TestClass(System.IO.TextWriter tw):base(tw, true){}
72
73         //BY DEFAULT LOGGING IS DONE TO THE STANDARD OUTPUT ONLY FOR FAILURES
74
75         public void run()
76         {
77                 Exception exp = null;
78                 try
79                 {
80                         BeginCase("DataColumnCollection_IndexOf_S");
81                         DataColumnCollection_IndexOf_S1();
82                 } 
83                 catch(Exception ex)
84                 {
85                         exp = ex;
86                 }
87                 finally
88                 {
89                         EndCase(exp);
90                         exp = null;
91                 }
92         }
93
94         private void DataColumnCollection_IndexOf_S1()
95         {
96                 DataTable dt = DataProvider.CreateParentDataTable();
97                 
98                 for (int i=0;i<dt.Columns.Count;i++)
99                 {
100                         Compare(dt.Columns.IndexOf(dt.Columns[i].ColumnName),i);
101
102                 }
103
104                 DataColumn col = new DataColumn();
105
106                 Compare(dt.Columns.IndexOf("temp1"),-1);
107
108                 Compare(dt.Columns.IndexOf((string)null),-1);
109         }
110
111 }
112 }