mocking
Yii framework unit Testing. How to mock time() and other standart functions?
I\'m writing unit test for my models. Most of them use many standart functions, like time(), date() and so on. What is best approach to mock these functions in Yii testing style?[详细]
2023-03-29 02:45 分类:问答PHPUnit: Mock methods of existing object
PHPUnit\'s getMock($classname, $mockmethods) creates a new object based on the given class name and lets me change/test the behavior of the methods I specified.[详细]
2023-03-28 10:15 分类:问答Testing : How to create fake object context using TypeMock for EF4 model
I am using EF4 in my application and I want to make test cases for DAL methods, which generally hit the database to get data. I am using the Typemock framework for Mocking. I want to mock database cal[详细]
2023-03-28 09:47 分类:问答How to mock $xhr with Jack?
I have a function like: function Aoeu($xhr) { $xhr(\'GET\', \'/url\', function(code, response) {}); }; How do I crea开发者_开发技巧te with Jack a $xhr mock that\'s to be passed into Aoeu()?[详细]
2023-03-28 08:41 分类:问答Using a Mock Location in Navigation App
I\'m trying to develop an application that will simulate a route through Google\'s Navigation application.I found some excellent examples of how to implement a mock location provider in some other pos[详细]
2023-03-28 02:37 分类:问答Asserting a call to a public method on the same mock instance
I have the following test [Test] public void Attack_TargetWith3Damage_CausesAttackerToDeal3DamageToTarget()[详细]
2023-03-27 19:14 分类:问答Mocking classes that implement IQueryable with Moq
I spent an evening trying to mock an object that implements IQueryable: public interface IRepo<T> : IQueryable<T>[详细]
2023-03-27 16:13 分类:问答Moq: Setup a mocked method to fail on the first call, succeed on the second
What\'s th开发者_开发问答e most succinct way to use Moq to mock a method that will throw an exception the first time it is called, then succeed the second time it is called?I would make use of Callbac[详细]
2023-03-27 15:08 分类:问答Mocking config values when testing a class using spring
I am trying to test a class like @Controller public class FailureController { @Value(\"#{configValues.defaultRedirectUrl}\")[详细]
2023-03-27 01:58 分类:问答Objective-C: NSInputStream and NSOutputStream for testing purposes
I have an class in my application that is initialized with an NSInputStream. For testing purposes i want to write data on an NSOutputStream which then is received by that input stream.[详细]
2023-03-26 18:16 分类:问答
加载中,请稍侯......