googlemock
Can Google Mock a method with a smart pointer return type?
I have a factory that returns a smart pointer. Regardless of what smart pointer I use, I can\'t get Google Mock to mock the factory method.[详细]
2023-04-09 11:47 分类:问答Google Mock giving compile error when attempting to specify a return value
I\'m using Google Test and Google Mock for my C++/Qt application. I\'ve been having great success with this setup until just now when I tried this:[详细]
2023-04-08 00:28 分类:问答Testing iterative code using mocks - does it make sense, how?
I want to test an algorithm using mocks. The algorithm - in the current implementation - iterates over a container class in multiple passes and set()s and get()s values from it. The test\'s purpose is[详细]
2023-04-04 02:17 分类:问答Unit Testing: coding to interfaces?
Currently my project is composed of various concrete classes.Now as I\'m getting into unit testing it looks like I\'m supposed to create an interface for each and every cla开发者_如何学编程ss (effecti[详细]
2023-03-18 16:38 分类:问答Google Mock: "no appropriate default constructor available"?
Using Visual Studio 2010 C++ with googlemock.I\'m trying to use a mock I created and I\'m getting the compiler error on the line:[详细]
2023-03-17 07:15 分类:问答Google Mock: leaked mock object found at program exit?
When I define my test as follows it works. TEST(MyService, WhenCalled_DoesTheRightThingTM) { // Arrange[详细]
2023-03-16 19:37 分类:问答How to create a mock class with operator[]?
I am having a class with operator[], like this : class Base { public: virtual ~Base(){} virtual const int & operator[]( const unsigned int index ) const = 0;[详细]
2023-03-15 12:02 分类:问答C++ Unit Testing: Stubs (not mocks)?
Just getting into Unit Testing with C++.It looks like I will need to write several stub classes as I go along.My understanding is there is a difference between Mocks and Stubs.Basically it seems Mocks[详细]
2023-03-13 05:19 分类:问答Method and mock with same class
I have class with 2 methods class A { void Fun() { if(FunRet开发者_开发知识库()>0){///} else {///}[详细]
2023-03-10 07:12 分类:问答GMock and mocking constructors in a class with non virtual methods
i need to mock a class that has only non virtual methods. This 开发者_StackOverflow中文版class[详细]
2023-03-06 18:42 分类:问答