I want to test a controller method in MVC unit test. For my controller method to test, I require a Request.Files[] collection with length one.
This is probably crazy. I want to take the idea of Dependency Injection to extremes. I have isolated all System.IO-related behavior into a single class so that I can mock that class in my other class
I\'ve created an extension method for SqlCommand that allows some additional work before executing the command:
How could I mock a 开发者_StackOverflowvoid method with parameters and change the value parameters?
I am writing some unit tests and I\'m getting an exception thrown from my real code when trying to do the following:
I know I 开发者_如何学Gowouldn\'t need this with Typemock, however, with something like MoQ , I need to use the adapter pattern to enable the creation of mocks via interfaces for code I don\'t control
I\'m new to moq and setting up mocks so i could do with a little help. How do I mock up an SqlDataReader using Moq?
I have to Unit Test a method (runMethod()) that uses a method from a开发者_运维技巧n inhereted abstract class to create a boolean. The method in the abstract class uses XmlDocuments and nodes to retri
I\'ve been trying to get to mock a method with vararg parameters using Mockito: interface A { B b(int x, int y, C... c);
I\'m new to开发者_如何学编程 mocking/testing and wanting to know what level should you go to when testing. For example in my code I have the following object: