diff options
Diffstat (limited to 'vendor/bandit/bandit/assertion_frameworks/snowhouse/example/boolean_operators.cpp')
-rw-r--r-- | vendor/bandit/bandit/assertion_frameworks/snowhouse/example/boolean_operators.cpp | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/vendor/bandit/bandit/assertion_frameworks/snowhouse/example/boolean_operators.cpp b/vendor/bandit/bandit/assertion_frameworks/snowhouse/example/boolean_operators.cpp new file mode 100644 index 00000000..3e4577a5 --- /dev/null +++ b/vendor/bandit/bandit/assertion_frameworks/snowhouse/example/boolean_operators.cpp @@ -0,0 +1,48 @@ +#include <snowhouse/snowhouse.h> +using namespace snowhouse; +#include "tests.h" + +void BooleanOperators() +{ + std::cout << "================================================" << std::endl; + std::cout << " Boolean operators" << std::endl; + std::cout << "================================================" << std::endl; + + std::cout << "ShouldHandleIsFalseOperator" << std::endl; + { + Assert::That(false, IsFalse()); + } + + std::cout << "ShouldHandleWhenIsFalseFails" << std::endl; + { + AssertTestFails(Assert::That(true, IsFalse()), "Expected: false"); + } + + std::cout << "ShouldHandleIsTrueOperator" << std::endl; + { + Assert::That(true, IsTrue()); + } + + std::cout << "ShouldHandleWhenIsTrueFails" << std::endl; + { + AssertTestFails(Assert::That(false, IsTrue()), "Expected: true"); + } + + std::cout << "ShouldHandleFluentIsTrue" << std::endl; + { + Assert::That(true, Is().True()); + AssertTestFails(Assert::That(false, Is().True()), "Expected: true"); + } + + std::cout << "ShouldHandleFluentIsFalse" << std::endl; + { + Assert::That(false, Is().False()); + AssertTestFails(Assert::That(true, Is().False()), "Expected: false"); + } + + std::cout << "ShouldTreatAssertWithoutConstraintAsBooleanConstrains" << std::endl; + { + Assert::That(true); + } +} + |