Thanks to Scott for quick reply.
I am still a little bit confused :? Maybe we are mocking out differnet thing :?:
Assume: In a test without TypeMock, I can have five files on hard drive which are "a.txt, b.txt, c.txt, a.bmp, b.bmp".
Then using TypeMock, I don't need to worry about the first parameter, path "D:", also I just mock out "GetFilesSinglePattern()" , set up the expectation returned as strArr, which includes "a.txt, b.txt, c.txt". Then the string array returned, strArr, can be consumed by other objects in test cases.
However my test case still want to test the second parameter, " *.txt " will work for me to filter five file names and just return 3 files, "a.txt, b.txt, c.txt", as I tested as follows( Does this test too much? :wink: ):
string [] strArr = KY_Utility.GetFilesSinglePattern( @"D:","*.txt");
Assert.AreEqual(3, strArr.Length);
Can TypeMock help this please? I am just trying to mock there are 5 file names, "a.txt, b.txt, c.txt, a.bmp, b.bmp". Then my test case will consume them for checking there are 3 ".txt" indeed. Then pass my test case without bothering real files on disk. :shock: