moq
Verifying a method called with certain derived parameter
Consider the following snippet; public enum ReportType {Monthly,Quarterly} public class BaseReport { public ReportType ReportType {get;set;}[详细]
2023-04-09 14:38 分类:问答moq returning dataReader
I\'m having a strange experience with moq/mocking. Im trying to mock the data going into a method so that i dont have to have adatabase availableat test time.[详细]
2023-04-09 08:24 分类:问答Testing with MOQ and Session State Wrapper
I\'m using a Session wrapper as written below. The problem I have is when running tests the try doesn\'t work and it goes to the catch so session variables are never being set. I\'m using Moq to creat[详细]
2023-04-09 04:18 分类:问答How do I create a mock using reflection with parameters using Moq?
I am trying to build a Generic testbuilder for generating objects, that i want to use in tests. One of the things I want to create is Mock implementations of interfaces. I want these Mocks to have Str[详细]
2023-04-08 18:37 分类:问答How can I use a mock when the code validates the types it receives
I want to test the following code: public IEnumerable<KeyValuePair<Fact, Exception>> ValidateAll()[详细]
2023-04-08 16:14 分类:问答Testing WinForms MVP and Event mechanism with moq
I\'ve been using MVP pattern in my application. But I have problems with testing my method which are called after button is clicked. Here is the code:[详细]
2023-04-07 18:27 分类:问答How to mock context while unit testing code using VirtualPathUtility.GetAbsolute method
I am running unit tests on code which uses VirtualParthUtility.GetAbsolute, but am having problems mocking the context for this to work.[详细]
2023-04-06 23:26 分类:问答Ninject.MockingKernel.Moq security exception
I am using Ninject for my IoC container and I\'m trying to write some unit tests.I found the Ninject Mocking Kernel so I thought I\'d give it a go but I can\'t get the simplest test to pass. I am miss[详细]
2023-04-06 20:06 分类:问答Do I really have to do write my code differently so just so I can test it?
I am coming to c# from ruby on rails where I did TDD using Rspec and Mocha. I was looking to get into get into a mocking framework and an older stackoverflow post pointed me in the direction of MOQ an[详细]
2023-04-06 17:35 分类:问答It.IsAny<Cart>(), It.IsAny<ShippingDetails>(), Times.Never(). What do they do?
I wonder if you could help me understand the following line: mock.Verify(m => m.ProcessOrder(It.IsAny<Cart>(),[详细]
2023-04-06 17:16 分类:问答