moq
Using MVC3 and EF4, how can one adequately test functionality that relies on a round trip to the database to create IDENTITY values?
I have a scenario where the code under test inserts a record into a database, then attempts to retrieve it back from the database using its primary key.[详细]
2023-04-13 07:48 分类:问答Usage of Moq When(Func<bool>) method
I can\'t find an example of the usage of the When method in Moq When(Func<bool> condition); What is the purpose/usage of the method? Please give a cod开发者_JAVA百科e sample demonstrating a s[详细]
2023-04-12 20:14 分类:问答Unit test protected method in C# using Moq
It came to my attention lately that you can unit test abstract base classes using Moq rather than creating a dummy class in test that implements the abstract base class. See How to use moq to test a c[详细]
2023-04-12 13:33 分类:问答Moq + Unit Testing - System.Reflection.TargetParameterCountException: Parameter count mismatch
I\'m tring to use a lambda with a multiple-params function but Moq throws this exception at runtime when I attempt to call the mock.Object.Convert(value, null, null, null); line.[详细]
2023-04-12 04:15 分类:问答How to verify the EventAggregator's unsubscribe method is called when disposing a ViewModel with Prism
I\'m struggling to write a test that confirms that I am correctly unsubscribing from an EventAggregator\'s message when it is closed. Anyone able to point out the (simple) answer?![详细]
2023-04-11 18:25 分类:问答Weird issue with Moq when trying to use Mock<T> for a generic type
A bit of code: public interface IMyInterface { in开发者_运维问答t GetIt(); } public class MyImplementation : IMyInterface[详细]
2023-04-11 12:35 分类:问答Moq with constructor argument
I have a factory that looks like below: public IFoo GetFoo(IFile file开发者_Go百科) { return _kernel.Get<IFoo>(new ConstructorArgument(\"file\", file));[详细]
2023-04-10 17:22 分类:问答Cannot reference moq.dll in C# 2010
I donwloaded Moq.4.0.10827开发者_JS百科 from www.code.google.com/p/moq and trying to add reference to Moq.4.0.10827\\NET40\\Moq.dll to Visual Studio 2010 C# project. Trying to build this project, I se[详细]
2023-04-10 14:03 分类:问答How to mock wcf service(transformed from asmx) by Moq
I have Silverligth Unit test Application (.net 4.0) and I\'ve added reference to my WCF service(3.5) And here are my codes[详细]
2023-04-09 22:34 分类:问答Unit testing LINQ to SQL CRUD operations using Moq
I\'ve had a look around at other questions, but nothing really matches what I\'m looking for... mainly because I\'m not 100% certain on what it is I\'m looking for![详细]
2023-04-09 15:04 分类:问答