Questions tagged [mocks]
In object-oriented programming, mock objects are simulated objects that mimic the behavior of real objects in controlled ways. A programmer typically creates a mock object to test the behavior of some other object, in much the same way that a car designer uses a crash test dummy to simulate the dynamic behavior of a human in vehicle impacts.
                65 questions
            
            
            
                3
            
            votes
        
        
            
                1
            
            answer
        
        
            
                66
            
            views
        
        
            
        Swift: Mocking a REST API-request
                    I have read the last two days through several tutorials about how to mock a HTTP-request against a REST API.
Finally I made a prototype for applying, what I have understood from the tutorials.
Here's ...
                
            
       
        
            
                4
            
            votes
        
        
            
                1
            
            answer
        
        
            
                221
            
            views
        
        
            
            
        Track and trace allocations
                    When testing or debugging allocator-aware objects, it can be useful to provide allocators that can provide insight into how they get called.  The Tracing_alloc from ...
                
            
       
        
            
                2
            
            votes
        
        
            
                0
            
            answers
        
        
            
                123
            
            views
        
        
            
            
        C++ Mock Library: Part 6
                    Parts
C++ Mock Library: Part 1
C++ Mock Library: Part 2
C++ Mock Library: Part 3
C++ Mock Library: Part 4
C++ Mock Library: Part 5
C++ Mock Library: Part 6
Side Note:
I will say the processes of ...
                
            
       
        
            
                3
            
            votes
        
        
            
                1
            
            answer
        
        
            
                119
            
            views
        
        
            
            
        C++ Mock Library: Part 4
                    Parts
C++ Mock Library: Part 1
C++ Mock Library: Part 2
C++ Mock Library: Part 3
C++ Mock Library: Part 4
C++ Mock Library: Part 5
 C++ Mock Library: Part 6
Description:
In part 3 I described how I ...
                
            
       
        
            
                2
            
            votes
        
        
            
                1
            
            answer
        
        
            
                93
            
            views
        
        
            
            
        C++ Mock Library: Part 3
                    Parts
C++ Mock Library: Part 1
C++ Mock Library: Part 2
C++ Mock Library: Part 3
C++ Mock Library: Part 4
C++ Mock Library: Part 5
 C++ Mock Library: Part 6
Define normal use case patterns:
The next ...
                
            
       
        
            
                3
            
            votes
        
        
            
                1
            
            answer
        
        
            
                165
            
            views
        
        
            
            
        C++ Mock Library: Part 2
                    Parts
C++ Mock Library: Part 1
C++ Mock Library: Part 2
C++ Mock Library: Part 3
C++ Mock Library: Part 4
C++ Mock Library: Part 5
 C++ Mock Library: Part 6
Removing redundant MOCK_SYS usage
After ...
                
            
       
        
            
                6
            
            votes
        
        
            
                1
            
            answer
        
        
            
                328
            
            views
        
        
            
            
        C++ Mock Library: Part 1
                    Parts
C++ Mock Library: Part 1
C++ Mock Library: Part 2
C++ Mock Library: Part 3
C++ Mock Library: Part 4
C++ Mock Library: Part 5
 C++ Mock Library: Part 6
Note:
If you see an extra ...
                
            
       
        
            
                3
            
            votes
        
        
            
                1
            
            answer
        
        
            
                165
            
            views
        
        
            
        End to End testing of user interaction in Rust
                    I am interested in any kind of possible improvement to this method of testing a Rust program with user interaction in an end-to-end manner (simulating user input and asserting a certain program output ...
                
            
       
        
            
                0
            
            votes
        
        
            
                1
            
            answer
        
        
            
                157
            
            views
        
        
            
        Unit testing and alternative to mocking in Haskell
                    Let's say you have a simple pure function that applies a discount of 30% if the total price of a list of Items is over 30.00 (let's not delve into the fact that I'm ...
                
            
       
        
            
                2
            
            votes
        
        
            
                1
            
            answer
        
        
            
                597
            
            views
        
        
            
            
            
        Basic Ticket booking code with Unit tests
                    I am going to run a session for a few other developers who are new to Junit, mocking, etc.
I have designed a very simple application with classes and tests to demonstrate how to do unit testing. ...
                
            
       
        
            
                0
            
            votes
        
        
            
                1
            
            answer
        
        
            
                117
            
            views
        
        
            
            
        First time writing tests (Service Layer)
                    Service class:
...
                
            
       
        
            
                3
            
            votes
        
        
            
                1
            
            answer
        
        
            
                164
            
            views
        
        
            
            
            
        Abstract wrapper for fundamental types
                    I have created this interface as part of my C++ learning path. This post inspired me a lot.
The idea is to use its concrete implementations to perform some actions before and after any change of the ...
                
            
       
        
            
                2
            
            votes
        
        
            
                1
            
            answer
        
        
            
                119
            
            views
        
        
            
        How to make the initialization of the mocks more readable?
                    In an Arduino project, I'm using some code which is a slightly modified version of a public library. I made several modifications to it:
I performed some minor changes I needed to make the code work.
...
                
            
       
        
            
                2
            
            votes
        
        
            
                0
            
            answers
        
        
            
                108
            
            views
        
        
        A terminal based atom feed reader written in golang
                    I'm a beginner trying to get a better understanding of golang so I decided to write an atom feeder that runs from the terminal.
I am using the gofeed library to parse the atom feeds and the tview ...
                
            
       
        
            
                2
            
            votes
        
        
            
                1
            
            answer
        
        
            
                358
            
            views
        
        
            
            
            
        Mockingbird c++ mocking framework
                    I have developed Mockingbird a mocking framework for c++, it depends on function injection, here is the code from the repository:
...
                
            
       
         
         
         
        