Skip to content

Instantly share code, notes, and snippets.

@khalidabuhakmeh
Created November 22, 2013 14:10
Show Gist options
  • Select an option

  • Save khalidabuhakmeh/7600446 to your computer and use it in GitHub Desktop.

Select an option

Save khalidabuhakmeh/7600446 to your computer and use it in GitHub Desktop.
Documentation Framework that turns your unit tests into documentation. While there are explicit settings below, you would most likely have sensible defaults for titles, section names, and documentation files external to your unit tests.
[Documentation(Section = "Math",
Intro = "addition_intro.md",
Conclusion = "addition_conclusion.md",
Order = 1 )]
public class Addition
{
[Fact]
[Documentation(Title = "Adding Two Numbers", Intro = "adding_two_numbers.md", Order = 1)]
public void Adding_two_numbers()
{
// unit test will be put in documentation
}
[Fact]
[Documentation(Title = "Adding Two Numbers", Intro = "adding_two_numbers.md", Order = 1)]
public void Adding_positive_and_negative_numbers()
{
// unit test will be put in documentation
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment