moq
Unit testing with Moq
Let\'s say I have a plain class with several functions: public class MyClass { public int GetTotal(int myValue, string myString)[详细]
2023-03-10 18:08 分类:问答mock object that implements gets and sets not defined in interface
Using Moq, RhinoMocks or a similar framework, is there a way to configure a mock to implement both get and set on all properties of an object even if the interface does not?[详细]
2023-03-10 14:12 分类:问答Verify method has been called with IEnumerable containing 'x' elements with Moq
I have a repository with an Add method that takes an IEnumerable as parameter: public void Add<T>(T item) where T : class, new(){}[详细]
2023-03-09 20:05 分类:问答Moq verify method fails even though method will be called
I have some troubles using Moq. Following unit test throws an exception, even though the according method will be called.[详细]
2023-03-09 16:28 分类:问答Specflow with MVC Model Validation Issue
I am using Specflow, nunit and moq to test the default MVC2 application registration as I learn SpecFlow.[详细]
2023-03-08 08:50 分类:问答How to create Mock for the abstract base class using MOQ framework?
I want to write unit tests for MyClass but its base class is an abstract class. public class MyClass : AbstractBaseClass[详细]
2023-03-08 06:31 分类:问答Moq - It.IsAny<string>() always returning null
What may 开发者_JS百科cause It.IsAny<string>() to return null at every call?Am I incorrect in assuming that it is designed to return a non-null string?[详细]
2023-03-08 00:25 分类:问答EF4.1 Code First Mocking With Moq
I am trying my hand on EF with EF4.1 Code Frist. I have developed my models, like: public class User { [Key][详细]
2023-03-07 10:34 分类:问答Verification of a function call on a mock object not matched when a params array is used
I have the following test: [Test] public void VerifyThat_WhenInitializingTheLoggingInterceptionFacility_TheLoggingInterceptorIsAdded()[详细]
2023-03-06 12:36 分类:问答How to moq a Func
Trying to unit test a class whose constructor takes in a Func. Not sure how to mock it using Moq. public class FooBar[详细]
2023-03-06 09:40 分类:问答