/
thomas-king
/
Raze
Обзор
Документация
Войти
/
thomas-king
/
Raze
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
main
lib/UnitTests/TestCase.cpp
43 строки
790 B
Ace Rodstin
Update tests
23 ноя 2023, 13:35
23 ноя 2023, 13:35
24b75eb
Код
Авторство
О чём код?
// // TestCase.cpp // UnitTests // // Created by Ace Rodstin on 11/1/23. // Updated by Ace Rodstin on 11/27/23. // // Copyright (C) Ace Rodstin 2023. All rights reserved. // #include "UnitTests/TestCase.h" using namespace unit_tests; TestCase::TestCase(Id id, Test test): id { id }, test { test } {} TestCase::Id TestCase::getId() const { return id; } bool TestCase::run() { auto isSuccess = true; auto assertions = test(); for (auto assertion : assertions) { auto isSatisfied = assertion.getResult(); if (!isSatisfied) { isSuccess = false; failedAssertion = assertion; break; } } return isSuccess; } Assertion TestCase::getFailedAssertion() const { return failedAssertion; }