public void UsingStatementsMustNotBeNestedAnalyzer_Success()
 {
     ThisCodebase.MustConformTo(
         RoslynConvention.UsingStatementsMustNotBeNested())
     .All(x => x.IsSatisfied)
     .Should()
     .BeTrue();
 }
 public void IfAndElseMustHaveBracesAnalyzer_Success()
 {
     ThisCodebase.MustConformTo(
         RoslynConvention.IfAndElseMustHaveBraces())
     .All(x => x.IsSatisfied)
     .Should()
     .BeTrue();
 }
 public void UsingStatementsMustNotBeNestedAnalyzer_FailesWhenFileHasUsingsInsideNamespace()
 {
     using (new TestSolution("TestSolution"))
     {
         ThisCodebase.MustConformTo(
             RoslynConvention.UsingStatementsMustNotBeNested())
         .Should()
         .Contain(x => x.IsSatisfied == false && x.SubjectName.EndsWith("SplitNamespaces.cs"));
     }
 }
 public void IfAndElseMustHaveBracesAnalyzer_FailsWhenElseBlockDoesNotHaveBrace()
 {
     using (new TestSolution("TestSolution"))
     {
         ThisCodebase.MustConformTo(
             RoslynConvention.IfAndElseMustHaveBraces())
         .Should()
         .Contain(x => x.IsSatisfied == false && x.SubjectName.EndsWith("ElseBracelessWonder.cs"));
     }
 }
 /// <summary>
 /// https://nakedsecurity.sophos.com/2014/02/24/anatomy-of-a-goto-fail-apples-ssl-bug-explained-plus-an-unofficial-patch/
 /// </summary>
 public void IfAndElseMustHaveBracesToReduceRiskOfGotoFail()
 {
     ThisCodebase
     .MustConformTo(RoslynConvention.IfAndElseMustHaveBraces());
 }