BenMorris / NetArchTest

A fluent API for .Net that can enforce architectural rules in unit tests.
MIT License
1.39k stars 82 forks source link

ResideInNamespaceContaining does not select nested types #53

Closed sm-g closed 4 years ago

sm-g commented 4 years ago
var t = typeof(Web.Api.Dto.Response.Account.AccountResponse.Nested);
var types = Types.InAssembly(t.Assembly)
                .That().ResideInNamespaceContaining("Response") 
                .GetTypes()
                .ToList();
Assert.Contains(t, types);

types is not empty when I run such test, but assertion fails

Regex r = new Regex("^.*Response.*$", RegexOptions.IgnoreCase);
var match = r.Match(t.Namespace);
Assert.True(match.Success);

this assertion works however

NeVeSpl commented 4 years ago

All nested classes were ignored by ResideInNamespaceContaining. Fixed in #59