unit testing - Failing in Code coverage Test with a simple class constructor -


i have class:

 public class sourceserverprovider : isourceserverprovider     {         private readonly isourceserver _sourceserver;         public sourceserverprovider()             :this(new sourceserver())         { }          public sourceserverprovider(isourceserver sourceserver)         {             _sourceserver = sourceserver;         }      } 

ms code coverage test complaints block:

public sourceserverprovider()             :this(new sourceserver())         { } 

i don't know how write unit test above block. please advise..

i tested followig code:

public class sourceserverprovider : isourceserverprovider { private readonly isourceserver _sourceserver; public sourceserverprovider()     : this(new sourceserver()) { }  public sourceserverprovider(isourceserver sourceserver) {     _sourceserver = sourceserver; } }  public interface isourceserver { }  public class sourceserver : isourceserver { }  public interface isourceserverprovider { } 

and wrote test

public class class1 {     [test]     public void test()     {         var = new sourceserverprovider();     } } 

code coverage says covered: here

so please add result getting or create asimple test call default ctor


Comments

Popular posts from this blog

php - regexp cyrillic filename not matches -

c# - OpenXML hanging while writing elements -

sql - Select Query has unexpected multiple records (MS Access) -