public string ConnectionString
{
get
{
switch(this.Importer)
{
case Importer.SqlServer:
return "Server=localhost;Database=Northwind";
case Importer.SqlServerOleDb:
return"Provider=SQLOLEDB;Data Source=localhost;Initial Catalog=Northwind";
default:
throw new NotSupportedException(
string.Format("Importer {0} is not supported yet.", this.Importer));
}
}
}
After running the code coverage tool (dotCover from JetBrains) I received the following picture:
First idea
So, my code was clear and understandable, but obviously not fully tested (green: covered by tests, red: not covered). I asked me the question, how could I test the rest of the method.
My idea was to extend the enum:
[TestFixture]
public class ConfigurationTest
{
#region Test methods