Initial Course
This commit is contained in:
@@ -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");
|
||||
}
|
||||
Reference in New Issue
Block a user