Friday, March 19, 2010

Sharp Architecture: An ISessionStorage has not been configured

A silly thing that one might miss while trying to setup a Sharp Architecture database test causing this error:

TestCase 'Example.BasicCategoryDBTests.CanGetAll'
failed: SharpArch.Core.PreconditionException : An ISessionStorage has not been configured
C:\MyStuff\Projects\SharpArchGitHub\src\SharpArch\SharpArch.Core\DesignByContract.cs(62,0): at SharpArch.Core.Check.Require(Boolean assertion, String message)
C:\MyStuff\Projects\SharpArchGitHub\src\SharpArch\SharpArch.Data\NHibernate\NHibernateSession.cs(174,0): at SharpArch.Data.NHibernate.NHibernateSession.CurrentFor(String factoryKey)
C:\MyStuff\Projects\SharpArchGitHub\src\SharpArch\SharpArch.Data\NHibernate\Repository.cs(32,0): at SharpArch.Data.NHibernate.RepositoryWithTypedId`2.get_Session()
C:\MyStuff\Projects\SharpArchGitHub\src\SharpArch\SharpArch.Data\NHibernate\Repository.cs(52,0): at SharpArch.Data.NHibernate.RepositoryWithTypedId`2.GetAll()

Don't forget, like I did, to inherit from DatabaseRepositoryTestsBase. Apparently I'm liking the ease of Sharp Architecture so much I'm forgetting to code properly, or it could be that it's Friday?

No comments: