New test.
[mono.git] / mcs / class / FirebirdSql.Data.Firebird / Test / FbDatabaseSchemaTest.cs
1 /*
2  *  Firebird ADO.NET Data provider for .NET and Mono 
3  * 
4  *     The contents of this file are subject to the Initial 
5  *     Developer's Public License Version 1.0 (the "License"); 
6  *     you may not use this file except in compliance with the 
7  *     License. You may obtain a copy of the License at 
8  *     http://www.firebirdsql.org/index.php?op=doc&id=idpl
9  *
10  *     Software distributed under the License is distributed on 
11  *     an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 
12  *     express or implied.  See the License for the specific 
13  *     language governing rights and limitations under the License.
14  * 
15  *  Copyright (c) 2002, 2004 Carlos Guzman Alvarez
16  *  All Rights Reserved.
17  */
18
19 using System;
20 using System.Data;
21 using System.Collections;
22 using FirebirdSql.Data.Firebird;
23 using FirebirdSql.Data.Firebird.Isql;
24 using NUnit.Framework;
25
26 namespace FirebirdSql.Data.Firebird.Tests
27 {
28     [TestFixture]
29     public class FbDatabaseSchemaTest : BaseTest
30     {
31         public FbDatabaseSchemaTest() : base(false)
32         {
33         }
34
35         [Test]
36         public void CharacterSets()
37         {
38             Connection.GetSchema("CharacterSets");
39         }
40
41         [Test]
42         public void CheckConstraints()
43         {
44             Connection.GetSchema("CheckConstraints");
45         }
46
47         [Test]
48         public void CheckConstraintsByTable()
49         {
50             Connection.GetSchema("CheckConstraintsByTable");
51         }
52
53         [Test]
54         public void Collations()
55         {
56             Connection.GetSchema("Collations");
57         }
58
59         [Test]
60         public void Columns()
61         {
62             DataTable columns = Connection.GetSchema("Columns");
63
64             columns = Connection.GetSchema(
65                             "Columns",
66                             new string[] { null, null, "TEST", "INT_FIELD" });
67
68             Assert.AreEqual(1, columns.Rows.Count);
69         }
70
71         [Test]
72         public void ColumnPrivileges()
73         {
74             Connection.GetSchema("ColumnPrivileges");
75         }
76
77         [Test]
78         public void Domains()
79         {
80             Connection.GetSchema("Domains");
81         }
82
83         [Test]
84         public void ForeignKeys()
85         {
86             Connection.GetSchema("ForeignKeys");
87         }
88
89         [Test]
90         public void Functions()
91         {
92             Connection.GetSchema("Functions");
93         }
94
95         [Test]
96         public void Generators()
97         {
98             Connection.GetSchema("Generators");
99         }
100
101         [Test]
102         public void Indexes()
103         {
104             Connection.GetSchema("Indexes");
105         }
106
107         [Test]
108         public void PrimaryKeys()
109         {
110             DataTable primaryKeys = Connection.GetSchema("PrimaryKeys");
111
112             primaryKeys = Connection.GetSchema(
113                 "PrimaryKeys",
114                 new string[] { null, null, "TEST" });
115
116             Assert.AreEqual(1, primaryKeys.Rows.Count);
117         }
118
119         [Test]
120         public void ProcedureParameters()
121         {
122             Connection.GetSchema("ProcedureParameters");
123
124             DataTable procedureParameters = Connection.GetSchema(
125                 "ProcedureParameters",
126                 new string[] { null, null, "SELECT_DATA" });
127
128             Assert.AreEqual(3, procedureParameters.Rows.Count);
129         }
130
131         [Test]
132         public void ProcedurePrivileges()
133         {
134             Connection.GetSchema("ProcedurePrivileges");
135         }
136
137         [Test]
138         public void Procedures()
139         {
140             DataTable procedures = Connection.GetSchema("Procedures");
141
142             procedures = Connection.GetSchema(
143                 "Procedures",
144                 new string[] { null, null, "SELECT_DATA" });
145
146             Assert.AreEqual(1, procedures.Rows.Count);
147         }
148
149         [Test]
150         public void DataTypes()
151         {
152             Connection.GetSchema("DataTypes");
153         }
154
155         [Test]
156         public void Roles()
157         {
158             Connection.GetSchema("Roles");
159         }
160
161         [Test]
162         public void Tables()
163         {
164             DataTable tables = Connection.GetSchema("Tables");
165
166             tables = Connection.GetSchema(
167                 "Tables",
168                 new string[] { null, null, "TEST" });
169
170             Assert.AreEqual(tables.Rows.Count, 1);
171
172             tables = Connection.GetSchema(
173                 "Tables",
174                 new string[] { null, null, null, "TABLE" });
175
176             Assert.AreEqual(tables.Rows.Count, 1);
177         }
178
179         [Test]
180         public void TableConstraints()
181         {
182             Connection.GetSchema("TableConstraints");
183         }
184
185         [Test]
186         public void TablePrivileges()
187         {
188             Connection.GetSchema("TablePrivileges");
189         }
190
191         [Test]
192         public void Triggers()
193         {
194             Connection.GetSchema("Triggers");
195         }
196
197         [Test]
198         public void UniqueKeys()
199         {
200             Connection.GetSchema("UniqueKeys");
201         }
202
203         [Test]
204         public void ViewColumnUsage()
205         {
206             Connection.GetSchema("ViewColumnUsage");
207         }
208
209         [Test]
210         public void Views()
211         {
212             Connection.GetSchema("Views");
213         }
214
215         [Test]
216         public void ViewPrivileges()
217         {
218             Connection.GetSchema("ViewPrivileges");
219         }
220     }
221 }