Files
chaos/ChaosTests/Service/ChaosExceptionTests.cpp
hashlag 6a09d81ae2
All checks were successful
Chaos Ci / test-and-benchmark (push) Successful in 2m2s
Add ChaosExceptionTests.
2026-02-06 18:05:57 +03:00

33 lines
642 B
C++

#include <gtest/gtest.h>
#include <string>
#include "Service/ChaosException.hpp"
using namespace Chaos::Service;
TEST(ChaosExceptionTests, RvalueRefCtorTest)
{
try
{
throw ChaosException("everything's alright :D");
}
catch (const ChaosException & ex)
{
ASSERT_EQ("everything's alright :D", ex.GetMessage());
}
}
TEST(ChaosExceptionTests, ConstLvalueRefCtorTest)
{
const std::string message = "everything's alright :D";
try
{
throw ChaosException(message);
}
catch (const ChaosException & ex)
{
ASSERT_EQ("everything's alright :D", ex.GetMessage());
}
}