StateConnectionTest.cpp 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Company: Lynar Studios
  4. * E-Mail: webmaster@lynarstudios.com
  5. * Created: 2020-09-10
  6. * Changed: 2020-09-10
  7. *
  8. * */
  9. #include <gtest/gtest.h>
  10. #include "../../../source/logic/StateConnection.hpp"
  11. namespace {
  12. class StateConnectionTest : public ::testing::Test {
  13. protected:
  14. StateConnectionTest() = default;
  15. ~StateConnectionTest() override = default;
  16. void SetUp() override {}
  17. void TearDown() override {}
  18. };
  19. TEST_F(StateConnectionTest, getConnectionId)
  20. {
  21. ls_std::StateConnection connection {"AB", "B"};
  22. ASSERT_STREQ("AB", connection.getConnectionId().c_str());
  23. }
  24. TEST_F(StateConnectionTest, getState)
  25. {
  26. ls_std::StateConnection connection {"AB", "B"};
  27. ASSERT_STREQ("B", connection.getStateId().c_str());
  28. }
  29. TEST_F(StateConnectionTest, isPassable)
  30. {
  31. ls_std::StateConnection connection {"AB", "B"};
  32. ASSERT_FALSE(connection.isPassable());
  33. }
  34. TEST_F(StateConnectionTest, updatePassCondition)
  35. {
  36. ls_std::StateConnection connection {"AB", "B"};
  37. ASSERT_FALSE(connection.isPassable());
  38. connection.updatePassCondition(true);
  39. ASSERT_TRUE(connection.isPassable());
  40. }
  41. }