Adding WCF integration to the build.
[castle.git] / ActiveRecord / Castle.ActiveRecord.Tests / BugTestCase.cs
blob6e9bb3c0785f1aa2ed350c282bea3625c79e9cfa
1 // Copyright 2004-2007 Castle Project - http://www.castleproject.org/
2 //
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
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
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.ActiveRecord.Tests
17 using System.Collections;
19 using NUnit.Framework;
21 [TestFixture]
22 public class BugTestCase : AbstractActiveRecordTest
24 [Test]
25 public void SemanticVisitorBug()
27 ActiveRecordStarter.Initialize(GetConfigSource(),
28 typeof(Bank), typeof(Customer), typeof(Card));
30 Recreate();
33 [Test]
34 public void InheritanceBug()
36 ActiveRecordStarter.Initialize(GetConfigSource(),
37 typeof(Parent), typeof(Child), typeof(GrandChild));
41 #region SemanticVisitorBug related
43 [ActiveRecord]
44 public class Bank : ActiveRecordBase
46 private int id;
47 private IList customers;
48 private Card card;
50 [PrimaryKey]
51 public int Id
53 get { return id; }
54 set { id = value; }
57 [BelongsTo]
58 public Card Card
60 get { return card; }
61 set { card = value; }
64 [HasMany(typeof(Customer))]
65 public IList Customers
67 get { return customers; }
68 set { customers = value; }
72 [ActiveRecord]
73 public class Customer : ActiveRecordBase
75 private int id;
76 private IList cards;
77 private Bank bank;
79 [PrimaryKey]
80 public int Id
82 get { return id; }
83 set { id = value; }
86 [BelongsTo]
87 public Bank Bank
89 get { return bank; }
90 set { bank = value; }
93 [HasMany(typeof(Card))]
94 public IList Cards
96 get { return cards; }
97 set { cards = value; }
101 [ActiveRecord]
102 public class Card : ActiveRecordBase
104 private int id;
105 private Customer customer;
107 [PrimaryKey]
108 public int Id
110 get { return id; }
111 set { id = value; }
114 [BelongsTo]
115 public Customer Customer
117 get { return customer; }
118 set { customer = value; }
122 #endregion
124 #region InheritanceBug related
126 public class Parent : ActiveRecordBase
128 private int id;
130 [PrimaryKey]
131 public int Id
133 get { return id; }
134 set { id = value; }
138 public class Child : Parent
142 [ActiveRecord]
143 public class GrandChild : Child
147 #endregion