Orderbook Simulation
OrderbookSim is a C++ application simulating a financial market order book. It efficiently manages and matches buy and sell orders while calculating the Volume-Weighted Average Price (VWAP).
Classes | Typedefs | Enumerations | Functions
test.cpp File Reference
#include "pch.h"
#include "../Orderbook.cpp"
#include "../Orderbook.h"
#include "../OrderbookLevelInfos.h"
#include "../OrderbookLevelInfos.cpp"
#include "../Order.h"
#include "../Order.cpp"

Classes

struct  Information
 Holds information about an action to be performed on the order book. More...
 
struct  Result
 Holds expected results for order book counts used for assertions. More...
 
class  InputHandler
 Parses test input files to extract actions and expected results. More...
 
class  OrderbookTestsFixture
 Test fixture for Orderbook tests, providing setup for test files and paths. More...
 

Typedefs

using Informations = std::vector< Information >
 
using Results = std::vector< Result >
 

Enumerations

enum class  ActionType { Add , Cancel , Modify }
 Defines the types of actions that can be performed on the order book. More...
 

Functions

 TEST_P (OrderbookTestsFixture, OrderbookTestSuite)
 Test case for the Orderbook functionality. More...
 
 INSTANTIATE_TEST_CASE_P (Tests, OrderbookTestsFixture, googletest::ValuesIn({ "Match_GoodTillCancel.txt", "Match_FillAndKill.txt", "Match_FillOrKill_Hit.txt", "Match_FillOrKill_Miss.txt", "Cancel_Success.txt", "Modify_Side.txt", "Match_Market.txt" }))
 Instantiates test cases for OrderbookTestsFixture using predefined test files. More...
 

Typedef Documentation

◆ Informations

using Informations = std::vector<Information>

◆ Results

using Results = std::vector<Result>

Enumeration Type Documentation

◆ ActionType

enum ActionType
strong

Defines the types of actions that can be performed on the order book.

Enumerator
Add 

Add a new order.

Cancel 

Cancel an existing order.

Modify 

Modify an existing order.

Function Documentation

◆ INSTANTIATE_TEST_CASE_P()

INSTANTIATE_TEST_CASE_P ( Tests  ,
OrderbookTestsFixture  ,
googletest::ValuesIn({ "Match_GoodTillCancel.txt", "Match_FillAndKill.txt", "Match_FillOrKill_Hit.txt", "Match_FillOrKill_Miss.txt", "Cancel_Success.txt", "Modify_Side.txt", "Match_Market.txt" })   
)

Instantiates test cases for OrderbookTestsFixture using predefined test files.

◆ TEST_P()

TEST_P ( OrderbookTestsFixture  ,
OrderbookTestSuite   
)

Test case for the Orderbook functionality.

This test case uses parameterized inputs to verify various Orderbook behaviors, including adding, modifying, and canceling orders.