c# - how to write test method for a method which is inside an internal Class? -
this question has answer here:
- how test internal class library? 1 answer
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
Post a Comment