Skip to content

unit tests

Diego Giacomelli edited this page Nov 3, 2018 · 3 revisions


For GeneticSharp we expected 100% of code coverage.

Coverage Status

You can see the current code quality status of the project on our Sonar Dashboard.


Each class should have a corresponding unit test class, for example:

GeneticSharp.Domain.Chromosomes.Gene class will have a unit test class called GeneticSharp.Domain.UnitTests.Chromosomes.GeneTest.


We use Roy Osherove's naming strategy, it's the following:


Bellow some real samples from GeneticSharp's unit tests:

public void Constructor_NullSelection_Exception()
public void Start_ParallelManyGenerations_Optimization()
public void Start_ParallelManySlowFitness_Timeout()
public void ReplaceGene_ValidIndex_Replaced()
You can’t perform that action at this time.