From 4bb3629a7638e7badb620c2a7f975694d710c93e Mon Sep 17 00:00:00 2001 From: Imbus <> Date: Wed, 27 Nov 2024 17:14:47 +0100 Subject: [PATCH] Some assertions in tabletest --- lab3/UserTableTest.cc | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 lab3/UserTableTest.cc diff --git a/lab3/UserTableTest.cc b/lab3/UserTableTest.cc new file mode 100644 index 0000000..9d989dd --- /dev/null +++ b/lab3/UserTableTest.cc @@ -0,0 +1,22 @@ +#include "UserTable.h" +#include "User.h" +#include + +int main() { + // Two identical users + User u1 = User(1234, "Name Nameson"); + User u2 = User(1234, "Name Nameson"); + + assert(u1.getName() == u2.getName()); + assert(u1.getCardNbr() == u2.getCardNbr()); + + // Two different users + User u3 = User(1200, "Name Surname"); + User u4 = User(1201, "Name Nameson"); + + assert(u3.getName() != u4.getName()); + assert(u3.getCardNbr() != u4.getCardNbr()); + + UserTable ut1 = UserTable("users.txt"); +} +