コード例 #1
0
 public void ViewModelsAssemblyMustNotTakeADependancyOn()
 {
     typeof(FeaturesAssembly).MustConformTo(Convention.MustNotTakeADependencyOn(typeof(AppAssembly), "TODO"));
     typeof(FeaturesAssembly).MustConformTo(Convention.MustNotTakeADependencyOn(typeof(ServicesConnectedAssembly), "TODO"));
     typeof(FeaturesAssembly).MustConformTo(Convention.MustNotTakeADependencyOn(typeof(ServicesDisconnectedAssembly), "TODO"));
     typeof(FeaturesAssembly).MustConformTo(Convention.MustNotTakeADependencyOn(typeof(TestsAssembly), "TODO"));
 }
 public void MustNotTakeDirectDependencyOnDbContext()
 {
     typeof(DbContext).Assembly.GetExportedTypes()
     .MustConformTo(Convention.MustNotTakeADependencyOn(typeof(DbContext),
                                                        "Because multithreading, transaction boundaries, testability etc."))
     .WithFailureAssertion(Assert.Fail);
 }
コード例 #3
0
        public void MustNotTakeADependencyOnConventionSpecification_FailsIfTheIdentifiedConstructorParameterExists()
        {
            var result = typeof(HasIllegalDependencies)
                         .MustConformTo(Convention.MustNotTakeADependencyOn(typeof(Dependency), "Because it shouldn't"));

            result.IsSatisfied.Should().BeFalse();
            result.Failures.Should().HaveCount(1);
        }
コード例 #4
0
 public void MustNotTakeADependencyOnConventionSpecification_Success()
 {
     typeof(HasNoIllegalDependencies)
     .MustConformTo(Convention.MustNotTakeADependencyOn(typeof(Dependency), "Because it shouldn't"))
     .IsSatisfied
     .Should()
     .BeTrue();
 }
コード例 #5
0
 public void AppAssemblyMustNotTakeADependancyOn()
 {
     typeof(AppAssembly).MustConformTo(Convention.MustNotTakeADependencyOn(typeof(FeaturesAssembly), "TODO"));
     typeof(AppAssembly).MustConformTo(Convention.MustNotTakeADependencyOn(typeof(TestsAssembly), "TODO"));
 }