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

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

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

android - How to create dynamically Fragment pager adapter -