moq
Mocking out nHibernate QueryOver with Moq
The following line fails with a null reference, when testing: var awards = _session.Qu开发者_JAVA技巧eryOver<Body>().Where(x => x.BusinessId == (int)business).List();[详细]
2023-04-06 12:12 分类:问答MVC3 Moq account controller c# nUnit
I am trying to learn Moq but it is proving somewhat difficult. If I want to implement some basic tests using nUnit and Moq for the account controller in a new MVC3 project, how would I go about it?[详细]
2023-04-06 10:05 分类:问答C# and Moq, raise event declared in interface from abstract class mock
I am writing the unit test and receive exception when trying to raise the event from abstract class mock. Here is the sample code:[详细]
2023-04-06 02:46 分类:问答moq file not found exception system.xml when accessing the mocked object
I am getting a file not found exception for this code: (System.IO.FileNotFoundException : Die Datei oder Assembly \"System.Xml, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e\" oder[详细]
2023-04-05 05:15 分类:问答Verifying indirectly called methods with Moq on a mocked object
My app has a ProviderFactory static class that has static开发者_开发知识库 utility methods passing back static instances of things like a logger. The rest of my app then can just grab a/the reference[详细]
2023-04-05 03:50 分类:问答moq mocking a buffer[] argument
I am trieing to mock the receive method of a socket. Here is workaround that i use to get the mock to work.[详细]
2023-04-04 16:34 分类:问答Verifying methods called with Moq
Trying to verify a method is being called withi开发者_运维知识库n a mock but cna\'t seem to figure out why I keep getting an exception thrown that it isn\'t being called. The method in question is as[详细]
2023-04-04 14:58 分类:问答How to unit test CanExecuteRoutedEventHandler?
I am trying to write a unit test for the following code: public static void AppExitCmdCanExecute(object sender,[详细]
2023-04-04 13:56 分类:问答how to generate fake data using moq for unit test?
I need to generate some data to unit test my repositories. i was using a loop to generate a list of objects, see codes below.I learned moq is a great mocking library, Can I use moq to generate that an[详细]
2023-04-04 07:42 分类:问答Mocking an interface that extends another interface using Moq
Hej Buddies! I\'m trying to create a mock for an interface like the one below: public interface ITheInterface: IEnumerable[详细]
2023-04-04 06:09 分类:问答