3 // Copyright 2004-2008 Castle Project - http://www.castleproject.org/
5 // Licensed under the Apache License, Version 2.0 (the "License");
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://www.apache.org/licenses/LICENSE-2.0
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
19 // This facility was a contribution kindly
20 // donated by Gilles Bayon <gilles.bayon@gmail.com>
26 namespace Castle
.Facilities
.IBatisNetIntegration
.Tests
28 using Castle
.Facilities
.IBatisNetIntegration
.Tests
.Dao
;
29 using Castle
.Facilities
.IBatisNetIntegration
.Tests
.Domain
;
31 using NUnit
.Framework
;
35 protected IWindsorContainer container
= null;
47 public void ResetDatabase()
49 IAccountDao dao
= container
["AccountDao"] as AccountDao
;
51 dao
.ResetTableAccount();
55 /// Verify that the input account is equal to the account(id=5).
57 /// <param name="account">An account object</param>
58 protected void AssertAccount1(Account account
)
60 Assert
.AreEqual(1, account
.Id
, "account.Id");
61 Assert
.AreEqual("Joe", account
.FirstName
, "account.FirstName");
62 Assert
.AreEqual("Dalton", account
.LastName
, "account.LastName");
63 Assert
.AreEqual("Joe.Dalton@somewhere.com", account
.EmailAddress
, "account.EmailAddress");
67 /// Verify that the input account is equal to the account(id=1).
69 /// <param name="account">An account object</param>
70 protected void AssertAccount5(Account account
)
72 Assert
.AreEqual(5, account
.Id
, "account.Id");
73 Assert
.AreEqual("Gilles", account
.FirstName
, "account.FirstName");
74 Assert
.AreEqual("Bayon", account
.LastName
, "account.LastName");
75 Assert
.AreEqual("no_email@provided.com", account
.EmailAddress
, "account.EmailAddress");