1 // Copyright 2004-2008 Castle Project - http://www.castleproject.org/
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
7 // http://www.apache.org/licenses/LICENSE-2.0
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
15 namespace Castle
.Facilities
.NHibernateIntegration
.Tests
17 using Castle
.Core
.Resource
;
19 using Castle
.Windsor
.Configuration
.Interpreters
;
21 using NHibernate
.Tool
.hbm2ddl
;
22 using NUnit
.Framework
;
24 public abstract class AbstractNHibernateTestCase
26 protected IWindsorContainer container
;
31 container
= new WindsorContainer(new XmlInterpreter(new ConfigResource()));
35 Configuration cfg1
= (Configuration
) container
[ "sessionFactory1.cfg" ];
36 SchemaExport export1
= new SchemaExport(cfg1
);
38 Configuration cfg2
= (Configuration
) container
[ "sessionFactory2.cfg" ];
39 SchemaExport export2
= new SchemaExport(cfg2
);
41 export1
.Create(false, true);
42 export2
.Create(false, true);
47 protected virtual void ConfigureContainer()
55 Configuration cfg1
= (Configuration
) container
[ "sessionFactory1.cfg" ];
56 SchemaExport export1
= new SchemaExport(cfg1
);
58 Configuration cfg2
= (Configuration
) container
[ "sessionFactory2.cfg" ];
59 SchemaExport export2
= new SchemaExport(cfg2
);
61 export2
.Drop(false, true);
62 export1
.Drop(false, true);