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
.ActiveRecordIntegration
.Tests
17 using NUnit
.Framework
;
19 using Castle
.Facilities
.ActiveRecordIntegration
.Tests
.Model
;
23 public class IntegrationTestCase
: AbstractActiveRecordTest
26 public void SimpleUsage()
31 Blog
[] blogs
= Blog
.FindAll();
33 Assert
.IsNotNull( blogs
);
34 Assert
.AreEqual( 0, blogs
.Length
);
36 Blog blog
= new Blog();
37 blog
.Name
= "hammett's blog";
38 blog
.Author
= "hamilton verissimo";
41 blogs
= Blog
.FindAll();
43 Assert
.IsNotNull( blogs
);
44 Assert
.AreEqual( 1, blogs
.Length
);
46 Blog retrieved
= blogs
[0];
47 Assert
.IsNotNull( retrieved
);
49 Assert
.AreEqual( blog
.Name
, retrieved
.Name
);
50 Assert
.AreEqual( blog
.Author
, retrieved
.Author
);
54 public void ComponentAutoWiring()
56 WiringSession wsession
= (WiringSession
) container
["wiring.service"];
58 wsession
.UsingISessionFactory();
60 wsession
.UsingISessionFactoryHolder();