ivaylokenov / MyTested.AspNetCore.Mvc

Fluent testing library for ASP.NET Core MVC.
https://docs.mytestedasp.net/
Other
1.73k stars 175 forks source link

Add option to include inherited attributes for controllers, actions and view components #374

Closed melikpehlivanov closed 3 years ago

melikpehlivanov commented 4 years ago

Closes #366

i.e

MyController<TestController>
                .ShouldHave()
                .Attributes(attributes => attributes.IncludingInherited()
                    .ContainingAttributeOfType<ValidateAntiForgeryTokenAttribute>()
                    ...

MyController<TestController>
                        .Calling(a => a.Index())
                        .ShouldHave()
                        .ActionAttributes(attributes => attributes.IncludingInherited()
                            .ContainingAttributeOfType<ValidateAntiForgeryTokenAttribute>()
                            ...

MyViewComponent<InheritViewComponent>
                .ShouldHave()
                .Attributes(attributes => attributes.IncludingInherited()
                    .ContainingAttributeOfType<ValidateAntiForgeryTokenAttribute>()
                   ...
CLAassistant commented 4 years ago

CLA assistant check
All committers have signed the CLA.