Archive

Archive for April, 2010

Magiq-to-NHibernate: Testing for different mapping strategies

April 24, 2010 2 comments

Magiq has a set of tests for each operation (insert, update, delete and query) that should work for any provider, besides the spescific tests that could be wrote for each provider. The problem I faced when testing nhibernate was how to test several mapping strategies with the same test cases.
The good news is it’s very easy with NUnit 🙂
NUnit fully supports parameterized tests, for test cases and fixtures. Using the Parameterized Test Fixtures feature in NUnit 2.5 I created a mapping folder for each strategy to test and added the folder name as a fest fixture parameter. That’s how the test looks likie:

[TestFixture("subclass")]
[TestFixture("joined-subclass")]
public class MagiqToNHibernateInsertsInheritanceTest {
    //..
}

I love NUnit!

Back to the road

April 20, 2010 Leave a comment

Today I opened Magiq solution for the very first time in weeks. I was actually busy in the past days doing a lot of work but now I’m ready to continue the project and posting.
My next moves with Magiq is:

  • Create the unit tests for <subclass>, <join-subclass>, <union-subclass> and <any> relationships.
  • Resolve the multitable update issue.
  • Fix the unit tests, one by one.

Now I’m working on the refactor of the unit tests for supporting different mappings. I hope this will be finished by the end of the day!

In the days coming I will be working on the multitable update issue, I expect some posting then 😉

Categories: Magiq