1 #ifndef GMOCK_TRANSACTION_H 2 #define GMOCK_TRANSACTION_H 4 #include <gmock/gmock.h> 7 #include <TransactionP.hpp> 9 #include "gmock-gobject.h" 12 GType gnc_mocktransaction_get_type(
void);
14 #define GNC_TYPE_MOCKTRANSACTION (gnc_mocktransaction_get_type ()) 15 #define GNC_IS_MOCKTRANSACTION(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNC_TYPE_MOCKTRANSACTION)) 25 description =
nullptr;
26 common_currency =
nullptr;
33 void*
operator new(
size_t size)
35 return mock_g_object_new (GNC_TYPE_MOCKTRANSACTION, NULL, size);
43 void operator delete(
void* trans,
size_t size)
45 mock_g_object_unref(trans, size);
48 MOCK_METHOD0(begin_edit,
void());
49 MOCK_METHOD0(commit_edit,
void());
50 MOCK_CONST_METHOD1(get_split, Split *(
int));
51 MOCK_CONST_METHOD0(get_split_list, GList*());
52 MOCK_CONST_METHOD1(find_split_by_account, Split *(
const Account*));
53 MOCK_CONST_METHOD0(get_date,
time64());
54 MOCK_METHOD1(set_date_posted_secs_normalized,
void(
time64));
55 MOCK_CONST_METHOD0(get_description,
const char *());
56 MOCK_METHOD1(set_description,
void(
const char*));
57 MOCK_CONST_METHOD0(get_currency, gnc_commodity *());
58 MOCK_CONST_METHOD0(get_notes,
const char *());
59 MOCK_METHOD1(set_notes,
void(
const char*));
60 MOCK_CONST_METHOD0(get_imbalance_value, gnc_numeric());
61 MOCK_CONST_METHOD0(get_num,
const char *());
62 MOCK_CONST_METHOD0(is_open, gboolean());
63 MOCK_METHOD0(destroy,
void());
64 MOCK_METHOD0(recordPrice,
void());
75 gnc_mocktransaction (Transaction *trans)
77 if (GNC_IS_MOCKTRANSACTION(trans))
79 ADD_FAILURE() <<
"Expected 'trans' to be of type 'MockTransaction'";
84 gnc_mocktransaction (
const Transaction *trans)
86 if (GNC_IS_MOCKTRANSACTION(trans))
88 ADD_FAILURE() <<
"Expected 'trans' to be of type 'MockTransaction'";
gint64 time64
Most systems that are currently maintained, including Microsoft Windows, BSD-derived Unixes and Linux...
API for Transactions and Splits (journal entries)