leetcode/tests/s0122_best_time_to_buy_and_...

18 lines
393 B
C++

#include "s0122_best_time_to_buy_and_sell_stock_ii.hpp"
#include <gtest/gtest.h>
TEST(Problem122, Case1) {
vector<int> prices{7, 1, 5, 3, 6, 4};
int expected{7};
S0122 solution;
EXPECT_EQ(solution.maxProfit(prices), expected);
}
TEST(Problem122, Case2) {
vector<int> prices{7, 6, 4, 3, 1};
int expected{0};
S0122 solution;
EXPECT_EQ(solution.maxProfit(prices), expected);
}