Skip to content

Solution Conventions

Andrew Best edited this page Mar 1, 2016 · 2 revisions

Solution conventions work with the raw files that comprise your solution. They are handed the solution root, and are free to work with the files and enforce conventions based on their textual composition.

All solution conventions derive from SolutionConventionSpecification

Configuration

Solution conventions need to know where to find the files that comprise the solution. To do this, simply set your solution root, and let Conventional do a recursive search from there for the first .sln file it can find

KnownPaths.SolutionRoot = @"c:\projects\MySolutionRoot"

Sample Usage

ThisSolution
    .MustConformTo(Convention.MustOnlyContainToDoAndNoteComments)
    .WithFailureAssertion(Assert.Fail);

Supplied Solution Conventions

  • Must only contain Todo and Note comments
  • Must only contain informative comments