Refactored the Kernel registration fluent interface to be more readable, better suppo...
[castle.git] / Facilities / IBatisNet / Castle.Facilities.IBatisNetIntegration.Tests / BaseTest.cs
blob8b8e8ecface494021d3b5ecef2243bcb7667a891
1 #region License
3 // Copyright 2004-2008 Castle Project - http://www.castleproject.org/
4 //
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
8 //
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
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.
16 //
17 // --
18 //
19 // This facility was a contribution kindly
20 // donated by Gilles Bayon <gilles.bayon@gmail.com>
21 //
22 // --
24 #endregion
26 namespace Castle.Facilities.IBatisNetIntegration.Tests
28 using Castle.Facilities.IBatisNetIntegration.Tests.Dao;
29 using Castle.Facilities.IBatisNetIntegration.Tests.Domain;
30 using Castle.Windsor;
31 using NUnit.Framework;
33 public class BaseTest
35 protected IWindsorContainer container = null;
37 /// <summary>
38 /// SetUp
39 /// </summary>
40 [SetUp]
41 public void Init()
43 container = null;
47 public void ResetDatabase()
49 IAccountDao dao = container["AccountDao"] as AccountDao;
51 dao.ResetTableAccount();
54 /// <summary>
55 /// Verify that the input account is equal to the account(id=5).
56 /// </summary>
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");
66 /// <summary>
67 /// Verify that the input account is equal to the account(id=1).
68 /// </summary>
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");