Finance manager
Лабораторна робота №2 - Документація коду
Loading...
Searching...
No Matches
Classes | Functions | Variables
test_exporter.cpp File Reference
#include "gtest/gtest.h"
#include "../Exporter.h"
#include "../Transaction.h"
#include <vector>
#include <fstream>
#include <string>
#include <cstdio>
Include dependency graph for test_exporter.cpp:

Classes

struct  ExporterTest
 

Functions

 TEST_F (ExporterTest, GIVEN_ValidTransactions_WHEN_ExportedAsCSV_THEN_FileContainsExpectedLines)
 
 TEST_F (ExporterTest, GIVEN_ValidTransactions_WHEN_ExportedAsExcel_THEN_FileContainsHeaderAndData)
 
 TEST_F (ExporterTest, GIVEN_NoTransactions_WHEN_Exported_THEN_FileIsEmptyOrHeaderOnly)
 
 TEST_F (ExporterTest, GIVEN_NegativeAmounts_WHEN_Exported_THEN_ValuesWrittenCorrectly)
 
 TEST_F (ExporterTest, GIVEN_InvalidFilePath_WHEN_Exported_THEN_ReturnsFalse)
 
 TEST_F (ExporterTest, GIVEN_DescriptionWithComma_WHEN_ExportedToCSV_THEN_CommaIsHandled)
 

Variables

constexpr double kAmount1 = 10.0
 
constexpr double kAmount2 = 20.5
 
constexpr long long kTime1 = 1672531200
 
constexpr long long kTime2 = 1672617600
 
constexpr double kTolerance = 1e-9
 

Function Documentation

◆ TEST_F() [1/6]

TEST_F ( ExporterTest  ,
GIVEN_DescriptionWithComma_WHEN_ExportedToCSV_THEN_CommaIsHandled   
)

◆ TEST_F() [2/6]

TEST_F ( ExporterTest  ,
GIVEN_InvalidFilePath_WHEN_Exported_THEN_ReturnsFalse   
)

◆ TEST_F() [3/6]

TEST_F ( ExporterTest  ,
GIVEN_NegativeAmounts_WHEN_Exported_THEN_ValuesWrittenCorrectly   
)

◆ TEST_F() [4/6]

TEST_F ( ExporterTest  ,
GIVEN_NoTransactions_WHEN_Exported_THEN_FileIsEmptyOrHeaderOnly   
)

◆ TEST_F() [5/6]

TEST_F ( ExporterTest  ,
GIVEN_ValidTransactions_WHEN_ExportedAsCSV_THEN_FileContainsExpectedLines   
)

◆ TEST_F() [6/6]

TEST_F ( ExporterTest  ,
GIVEN_ValidTransactions_WHEN_ExportedAsExcel_THEN_FileContainsHeaderAndData   
)

Variable Documentation

◆ kAmount1

constexpr double kAmount1 = 10.0
constexpr

◆ kAmount2

constexpr double kAmount2 = 20.5
constexpr

◆ kTime1

constexpr long long kTime1 = 1672531200
constexpr

◆ kTime2

constexpr long long kTime2 = 1672617600
constexpr

◆ kTolerance

constexpr double kTolerance = 1e-9
constexpr