Permalink
Browse files

Closes #37 LinqRepository cannot be cast to ILinqRepository

  • Loading branch information...
1 parent f165bc1 commit ac6d2d1f6de9a0e8ed0e0e5f6d66e2c8aadc5fef @seif seif committed Feb 7, 2012
View
@@ -22,4 +22,6 @@ StyleCop.Cache
SpecificationReports
NugetWorkspace
Packages
-Common/AssemblyVersion.cs
+Common/AssemblyVersion.cs
+*.DotSettings.user
+
@@ -1,6 +1,8 @@
namespace SharpArch.NHibernate
{
- public class LinqRepository<T> : LinqRepositoryWithTypedId<T, int>
+ using SharpArch.Domain.PersistenceSupport;
+
+ public class LinqRepository<T> : LinqRepositoryWithTypedId<T, int>, ILinqRepository<T>
{
}
}
@@ -0,0 +1,25 @@
+namespace Tests.SharpArch.NHibernate
+{
+ using NUnit.Framework;
+
+ using global::SharpArch.Domain.PersistenceSupport;
+ using global::SharpArch.NHibernate;
+ using global::SharpArch.Testing.NUnit;
+
+ [TestFixture]
+ public class RepositoryTests
+ {
+ [Test]
+ public void CanCastConcreteLinqRepositoryToInterfaceILinqRepository()
+ {
+ LinqRepository<MyEntity> concreteRepository = new LinqRepository<MyEntity>();
+ ILinqRepository<MyEntity> castRepository = concreteRepository as ILinqRepository<MyEntity>;
+ castRepository.ShouldNotBeNull();
+ }
+ }
+
+ public class MyEntity
+ {
+ private string Name { get; set; }
+ }
+}
@@ -137,6 +137,7 @@
<Compile Include="SharpArch.Domain\DomainModel\EntityTests.cs" />
<Compile Include="SharpArch.Domain\DomainModel\ValueObjectTests.cs" />
<Compile Include="SharpArch.NHibernate\NHibernateSessionTests.cs" />
+ <Compile Include="SharpArch.NHibernate\RepositoryTests.cs" />
<Compile Include="SharpArch.NHibernate\RepositoryTestsHelper.cs" />
<Compile Include="SharpArch.NHibernate\SafeServiceLocatorTests.cs" />
<Compile Include="SharpArch.Web.Mvc\JsonNet\JsonNetResultTests.cs" />

0 comments on commit ac6d2d1

Please sign in to comment.