Basic Google Test - Passing
raw download clone
CPP
views 8
,
size 543 b
#include <algorithm>
#include <iostream>
#include <stdexcept>
#include <vector>
#include <cassert>
#include <set>
#include <gtest/gtest.h>

using namespace std;

class BankAccount{
public:
    int balance{0};

    BankAccount(){

    }

    BankAccount(int init_amount):balance{init_amount}{
    }

};

TEST(AccountText, TestStartBalanceZero){
    BankAccount account;
    EXPECT_EQ(0, account.balance);
}

int main(int argc, char* argv[]){
   testing::InitGoogleTest(&argc, argv);
   return RUN_ALL_TESTS();
}
close fullscreen
Login or Register to edit or fork this paste. It's free.