Initial Course

This commit is contained in:
David Gil de Gómez Pérez
2026-08-11 17:40:36 +03:00
commit 9aed1d1d86
202 changed files with 3420 additions and 0 deletions
@@ -0,0 +1,16 @@
#include "classes_and_objects.hpp"
#include <gtest/gtest.h>
TEST(ClassesAndObjects, DepositAndWithdraw) {
oop::BankAccount account("Ada", 100.0);
account.deposit(50.0);
EXPECT_DOUBLE_EQ(account.balance(), 150.0);
EXPECT_TRUE(account.withdraw(30.0));
EXPECT_DOUBLE_EQ(account.balance(), 120.0);
EXPECT_FALSE(account.withdraw(1000.0));
}
TEST(ClassesAndObjects, OwnerName) {
oop::BankAccount account("Grace");
EXPECT_EQ(account.owner(), "Grace");
}