Skip to content

Instantly share code, notes, and snippets.

@RyanSusana
Last active December 1, 2021 15:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RyanSusana/e1d158536a85411b9e37e402168e1fee to your computer and use it in GitHub Desktop.
Save RyanSusana/e1d158536a85411b9e37e402168e1fee to your computer and use it in GitHub Desktop.
[Test]
public void ServicesShouldBeAuthorized()
{
var services = Classes().That()
.DependOnAny(typeof(ServerCallContext))
.And().AreNotAbstract()
.As("Services");
var rule = services
.Should()
.HaveAnyAttributesThat()
.Are(typeof(AuthorizeAttribute));
// _architecture is loaded in on test startup
rule.AssertValid(_architecture);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment