c# - how to write test method for a method which is inside an internal Class? -


this question has answer here:

i have internal class multiple methods inside it, want write nunit each method, how can call method? note: method has interface.

sample code:

internal class sample : issample {     public string getvalueabc(int a, int b)     {         string h="value:"+a+"and another:"+b;         return h;     } } 

you can return class other publicly available method this:

public class mysamplefactory {     public isample createsample()     {         return new sample();     } }  //inside unit test isample sample = mysamplefactory.createsample(); sample.getvalueabc(); 

Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -