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();
        }

}
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to