The following code results false:
using NetArchTest.Rules;
var result = Types.InCurrentDomain()
.That()
.HaveNameStartingWith("MyClass")
.Should()
.OnlyHaveDependenciesOn("System", "NetArchTestLabs")
.GetResult();
Console.WriteLine(result.IsSuccessful); // should be true
namespace NetArchTestLabs
{
public static class MyClass
{
private static readonly MyEnum[] _values = { MyEnum.A, MyEnum.B, MyEnum.C };
}
public enum MyEnum
{
D,
A,
B,
C,
Z
}
}
Am I missing something here or is it expected?
If I remove the first element of the enum, weirdly it behaves as expected, resulting true.
Here is a reproducible example:
https://github.com/jonataspc/NetArchTestLabs