| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Convention over Configuration is a great way to cut down repetitive boilerplate code. But how do you validate that your code adheres to your conventions? TestStack.ConventionTests is a simple NuGet library that makes it easy to build validation rules for convention validation tests.
TestStack.ConventionTests also will generate a convention report of the conventions present in your codebase, which you can publish as living documentation
[Test]
public void DomainHasVirtualMethodsConvention()
{
// Define some data
var nHibernateEntities = Types.InAssemblyOf<SampleDomainClass>()
.ConcreteTypes().InNamespace(typeof (SampleDomainClass).Namespace)
.ToTypes("nHibernate Entitites");
// Apply convention to data
Convention.Is(new AllMethodsAreVirtual(), nhibernateEntities);
}
For more information view the TestStack.ConventionTests documentation
Here is a list of some of the pacakged conventions
If you would like to define your own conventions see Defining Conventions
Krzysztof Koźmic first spoke about ConventionTests at NDC 2012. You can find the video of that talk here, slides here and the introductory blog post here.
In v2, we have rewritten convention tests from the ground up to make it easier to get started, bundle some default conventions and also decouple it from a specific unit testing framework.
There is still plenty we can make better, so please raise issues on github with suggestions!
Docs are available at TestStack.ConventionTests documentation
| Back | FazBrowse Home | New Git URL |