@c.sokun : did that work for you?
On Tue, Nov 11, 2008 at 7:51 AM, Simone Busoli <[EMAIL PROTECTED]> wrote:
> use Repository<Partner>
>
> On Tue, Nov 11, 2008 at 1:47 PM, c.sokun <[EMAIL PROTECTED]> wrote:
>>
>> Can someone show me how to inject IRepository<T> in my test code?
>> I got basic setup bellow & I want to automatically inject
>> partnerRepository.
>>
>> [TestFixture]
>> public class PartnerTest : DatabaseTestFixtureBase
>> {
>> private IRepository<Partner> partnerRepository;
>>
>> [TestFixtureSetUp]
>> public void InitializeNHibernate()
>> {
>> IntializeNHibernateAndIoC(
>> PersistenceFramework.ActiveRecord,
>> "windsor.boo",
>> MappingInfo.From(Assembly.Load("MyTest.Model")));
>> }
>>
>> [Test]
>> public void Can_Create_Partner()
>> {
>> Partner partner = new Partner();
>> partner.Name = "Business Partner #1";
>> partnerRepository.Save(partner);
>>
>> Assert.AreEqual(1, partner.Id);
>> }
>>
>> [SetUp]
>> public void Init()
>> {
>> CurrentContext.CreateUnitOfWork();
>> }
>>
>> [TearDown]
>> public void TearDown()
>> {
>> CurrentContext.DisposeUnitOfWork();
>> }
>>
>> }
>>
>
>
> >
>
--
"Injustice anywhere is a threat to justice everywhere."
Martin Luther King, Jr.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Rhino Tools Dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rhino-tools-dev?hl=en
-~----------~----~----~----~------~----~------~--~---