@@ -64,20 +64,23 @@ The library is available as a package on NuGet: [NetArchTest.eNhancedEdition](ht
6464[TestClass ]
6565public class SampleApp_ModuleAlpha_Tests
6666{
67- static readonly Assembly AssemblyUnderTest = typeof (SampleApp .ModuleAlpha .TestUtils ).Assembly ;
67+ static readonly Assembly AssemblyUnderTest = typeof (TestUtils ).Assembly ;
68+
6869 [TestMethod ]
6970 public void PersistenceIsNotAccessibleFromOutsideOfModuleExceptOfDbContext ()
7071 {
7172 var result = Types .InAssembly (AssemblyUnderTest )
7273 .That ()
73- .ResideInNamespace (" SampleApp.ModuleAlpha.Persistence" )
74+ .ResideInNamespace (" SampleApp.ModuleAlpha.Persistence" )
7475 .And ()
7576 .DoNotHaveNameEndingWith (" DbContext" )
7677 .Should ()
7778 .NotBePublic ()
7879 .GetResult ();
80+
7981 Assert .IsTrue (result .IsSuccessful );
8082 }
83+
8184 [TestMethod ]
8285 public void DomainIsIndependent ()
8386 {
@@ -89,11 +92,32 @@ public class SampleApp_ModuleAlpha_Tests
8992 " System" ,
9093 " SampleApp.ModuleAlpha.Domain" ,
9194 " SampleApp.SharedKernel.Domain" ,
92- " SampleApp.BuildingBlocks.Domain"
95+ " SampleApp.BuildingBlocks.Domain"
9396 )
9497 .GetResult ();
98+
9599 Assert .IsTrue (result .IsSuccessful , " Domain has lost its independence!" );
96100 }
101+
102+ }
103+
104+ [TestClass ]
105+ public class SampleApp_ModuleOmega_Tests
106+ {
107+ static readonly Assembly AssemblyUnderTest = typeof (TestUtils ).Assembly ;
108+
109+ [TestMethod ]
110+ public void RequestHandlersShouldBeSealed ()
111+ {
112+ var result = Types .InAssembly (AssemblyUnderTest )
113+ .That ()
114+ .ImplementInterface (typeof (IRequestHandler <,>))
115+ .Should ()
116+ .BeSealed ()
117+ .GetResult ();
118+
119+ Assert .IsTrue (result .IsSuccessful );
120+ }
97121}
98122```
99123
0 commit comments