C
C#7mo ago
kmanjt

NetArchTests Not Detecting Project References

anyone here familiar with netarchtests? I am trying to enforce clean architecture, and for some reason, it is not detecting project references:
[TestMethod]
public void Application_ShouldNotHave_DependencyOnOtherProjects()
{
var assembly = typeof(Application.AssemblyReference).Assembly;
var otherProjects = new[] { CoreNamespace, InfrastructureNamespace, ContractsNamespace, ApiNamespace, ArpNamespace };

var test = Types.InAssembly(assembly)
.ShouldNot()
.HaveDependencyOnAny(otherProjects)
.GetResult();

Assert.IsTrue(test.IsSuccessful, GenerateErrorMessage(test));
}
[TestMethod]
public void Application_ShouldNotHave_DependencyOnOtherProjects()
{
var assembly = typeof(Application.AssemblyReference).Assembly;
var otherProjects = new[] { CoreNamespace, InfrastructureNamespace, ContractsNamespace, ApiNamespace, ArpNamespace };

var test = Types.InAssembly(assembly)
.ShouldNot()
.HaveDependencyOnAny(otherProjects)
.GetResult();

Assert.IsTrue(test.IsSuccessful, GenerateErrorMessage(test));
}
The above test should fail, but isnt -- note: assume namespace strings are correct
1 Reply
kmanjt
kmanjtOP7mo ago
Bump
Want results from more Discord servers?
Add your server