mocking
How to test rspec ActiveRecord queries with multiple assocations
I have several methods that query the database if the right paramater is passed in, and am trying to find the best way to test them.[详细]
2023-04-03 21:24 分类:问答How to mock Spring SecurityContext so I can use it with TestNG?
I have to build a Unit test to test some user actions, when they are authenticated. I have everything in place with EasyMock and TestNG.[详细]
2023-04-03 13:16 分类:问答How to use Moq to test a method with no return value?
This is my first question so please be kind! :) What I am trying to do is write some tests for a manager class that during construction adds many new instances of a single item class to a list.When t[详细]
2023-04-02 14:34 分类:问答Temporary "unpatching" functionality within mock.side_effect
Is there any way to temporary undo patching using mock within side_effect? In particular I\'d like to make something like this work:[详细]
2023-04-02 05:08 分类:问答Why can't .NET mock frameworks use new to hide non-virtual methods for non-sealed classes?
For example: public class ThirdPartyClass { public void DoSomething() { ... } } // Mock framework generated class[详细]
2023-04-02 04:50 分类:问答How can I write Unit Tests for a method that has a call to a base method in the base object
I have the following code: class MyBase { public virtual void foo() { ... } } class MyDerived : MyBase { public override void fo开发者_运维百科o()[详细]
2023-04-02 01:17 分类:问答mock datareader failing on second call
In the test below, the mocked datareader returns the desired value the first time, but then returns the same value when the index should be 1.[详细]
2023-04-02 01:06 分类:问答Mocking before importing a module
How can I patch and mock getLogger in this module under test (MUT): # Start of the module under test import logging[详细]
2023-04-02 00:10 分类:问答How do you use Moles to mole DbContext from querying the database in EntityFramework 4.1?
I am using Entity Framework 4.1 for database access and would like to Unit Test the following code: // Get all the entities including children[详细]
2023-04-01 22:16 分类:问答Testing property set with a List in Rhino Mocks
I feel like I h开发者_开发知识库ave lost my mind because I am sure I have done this before. Hopefully one of you can point me in the right direction.[详细]
2023-04-01 19:53 分类:问答