summaryrefslogtreecommitdiffstats
path: root/StringTools/Test/test.cpp
blob: 80b7166996900706b21fb9908f050df576ee4ce1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#define CATCH_CONFIG_MAIN
#include "Catch2.h"

int Add(int a, int b)
{
    return a+b;
}

TEST_CASE("Add works with zeroes", "[add]")
{
    REQUIRE(Add(0, 0) == 0);
    REQUIRE(Add(5, 0) == 5);
    REQUIRE(Add(0, 5) == 5);
}

TEST_CASE("Add works with negatives", "[add]")
{
    REQUIRE(Add(-5, 0) == -5);
    REQUIRE(Add(0, -5) == -5);
    REQUIRE(Add(-5, -5) == -10);
}