example_tests.cpp 506 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
#include <catch.hpp>
#include <pls/library.h>

// BDD style
SCENARIO( "the test_adder works", "[library]" ) {
    GIVEN ("two numbers") {
        WHEN ( "they are positive") {
            THEN ( "the result is positive") {
                REQUIRE(pls::test_adder(1, 2) >= 0);
            }
            THEN ( "the result is the sum of both") {
                REQUIRE(pls::test_adder(1, 4) == 5);
            }
        }
    }
}


// Normal Style
TEST_CASE( "the test_adder can sumup", "[libray]") {
    
}