ClassTest.cpp 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Company: Lynar Studios
  4. * E-Mail: webmaster@lynarstudios.com
  5. * Created: 2020-08-16
  6. * Changed: 2021-04-24
  7. *
  8. * */
  9. #include <gtest/gtest.h>
  10. #include <ls_std/ls_std.hpp>
  11. #include <ls_std_test.hpp>
  12. namespace
  13. {
  14. class ClassTest : public ::testing::Test
  15. {
  16. protected:
  17. ClassTest() = default;
  18. ~ClassTest() override = default;
  19. void SetUp() override
  20. {}
  21. void TearDown() override
  22. {}
  23. };
  24. TEST_F(ClassTest, Destructor)
  25. {
  26. std::shared_ptr<ls_std_test::ClassMock> object = std::make_shared<ls_std_test::ClassMock>();
  27. EXPECT_CALL(*object, Die());
  28. }
  29. TEST_F(ClassTest, getClassName)
  30. {
  31. ls_std::Class object{"Class"};
  32. ASSERT_STREQ("Class", object.getClassName().c_str());
  33. }
  34. TEST_F(ClassTest, getClassName_emptyName)
  35. {
  36. EXPECT_THROW({
  37. try
  38. {
  39. ls_std::Class object{""};
  40. }
  41. catch (const ls_std::IllegalArgumentException &_exception)
  42. {
  43. throw;
  44. }
  45. }, ls_std::IllegalArgumentException);
  46. }
  47. }