Hi,
I have the following method for which I am trying to write a unit test:
using StaticClass; // writen by some one else, have a dll
namespace Test
{
Class TestClass
{
public void DoSomething(string param1)
{
List<string> = StaticClass.GetList(param1)
// sort the list and do other studd here
}
}
}
When I am not sure how to write a test for the DoSomething method, that depends on a static method in another class. The output of that method depends on things like the database on that machine, the environment and few other other factors. So if databases on two machines are different, the same method would give different results. All I know is that GetList returns some value and that method may or maynot have been unit tested by the creator of that class.
How can I test such a method? Is it possible to say something like, whenever StaticClass.Getlist method is called return a custom List<String>
that i created in my program? I am writing tests on c#.
Thanks,