|
@@ -3,7 +3,7 @@
|
|
|
* Company: Lynar Studios
|
|
|
* E-Mail: webmaster@lynarstudios.com
|
|
|
* Created: 2020-11-14
|
|
|
- * Changed: 2022-05-14
|
|
|
+ * Changed: 2022-05-16
|
|
|
*
|
|
|
* */
|
|
|
|
|
@@ -47,9 +47,9 @@ namespace
|
|
|
this->createCars();
|
|
|
ls::std::event::Narrator paintingMachine{};
|
|
|
|
|
|
- ASSERT_TRUE(paintingMachine.addListener(std::dynamic_pointer_cast<ls::std::core::IListener>(this->mercedes1)));
|
|
|
- ASSERT_TRUE(paintingMachine.addListener(std::dynamic_pointer_cast<ls::std::core::IListener>(this->mercedes2)));
|
|
|
- ASSERT_TRUE(paintingMachine.addListener(std::dynamic_pointer_cast<ls::std::core::IListener>(this->mercedes3)));
|
|
|
+ ASSERT_TRUE(paintingMachine.addListener(std::dynamic_pointer_cast<ls::std::core::interface::IListener>(this->mercedes1)));
|
|
|
+ ASSERT_TRUE(paintingMachine.addListener(std::dynamic_pointer_cast<ls::std::core::interface::IListener>(this->mercedes2)));
|
|
|
+ ASSERT_TRUE(paintingMachine.addListener(std::dynamic_pointer_cast<ls::std::core::interface::IListener>(this->mercedes3)));
|
|
|
}
|
|
|
|
|
|
TEST_F(NarratorTest, addListener_listener_already_exists)
|
|
@@ -57,8 +57,8 @@ namespace
|
|
|
this->createCars();
|
|
|
ls::std::event::Narrator paintingMachine{};
|
|
|
|
|
|
- ASSERT_TRUE(paintingMachine.addListener(std::dynamic_pointer_cast<ls::std::core::IListener>(this->mercedes1)));
|
|
|
- ASSERT_FALSE(paintingMachine.addListener(std::dynamic_pointer_cast<ls::std::core::IListener>(this->mercedes1)));
|
|
|
+ ASSERT_TRUE(paintingMachine.addListener(std::dynamic_pointer_cast<ls::std::core::interface::IListener>(this->mercedes1)));
|
|
|
+ ASSERT_FALSE(paintingMachine.addListener(std::dynamic_pointer_cast<ls::std::core::interface::IListener>(this->mercedes1)));
|
|
|
}
|
|
|
|
|
|
TEST_F(NarratorTest, addListener_no_reference)
|
|
@@ -80,9 +80,9 @@ namespace
|
|
|
{
|
|
|
this->createCars();
|
|
|
ls::std::event::Narrator paintingMachine{};
|
|
|
- paintingMachine.addListener(std::dynamic_pointer_cast<ls::std::core::IListener>(this->mercedes1));
|
|
|
- paintingMachine.addListener(std::dynamic_pointer_cast<ls::std::core::IListener>(this->mercedes2));
|
|
|
- paintingMachine.addListener(std::dynamic_pointer_cast<ls::std::core::IListener>(this->mercedes3));
|
|
|
+ paintingMachine.addListener(std::dynamic_pointer_cast<ls::std::core::interface::IListener>(this->mercedes1));
|
|
|
+ paintingMachine.addListener(std::dynamic_pointer_cast<ls::std::core::interface::IListener>(this->mercedes2));
|
|
|
+ paintingMachine.addListener(std::dynamic_pointer_cast<ls::std::core::interface::IListener>(this->mercedes3));
|
|
|
|
|
|
ASSERT_FALSE(paintingMachine.getListeners().empty());
|
|
|
paintingMachine.clear();
|
|
@@ -99,9 +99,9 @@ namespace
|
|
|
{
|
|
|
this->createCars();
|
|
|
ls::std::event::Narrator paintingMachine{};
|
|
|
- paintingMachine.addListener(std::dynamic_pointer_cast<ls::std::core::IListener>(this->mercedes1));
|
|
|
- paintingMachine.addListener(std::dynamic_pointer_cast<ls::std::core::IListener>(this->mercedes2));
|
|
|
- paintingMachine.addListener(std::dynamic_pointer_cast<ls::std::core::IListener>(this->mercedes3));
|
|
|
+ paintingMachine.addListener(std::dynamic_pointer_cast<ls::std::core::interface::IListener>(this->mercedes1));
|
|
|
+ paintingMachine.addListener(std::dynamic_pointer_cast<ls::std::core::interface::IListener>(this->mercedes2));
|
|
|
+ paintingMachine.addListener(std::dynamic_pointer_cast<ls::std::core::interface::IListener>(this->mercedes3));
|
|
|
|
|
|
ASSERT_TRUE(paintingMachine.removeListener(this->mercedes2));
|
|
|
ASSERT_TRUE(paintingMachine.removeListener(this->mercedes1));
|
|
@@ -135,9 +135,9 @@ namespace
|
|
|
{
|
|
|
this->createCars();
|
|
|
ls::std::event::Narrator paintingMachine{};
|
|
|
- paintingMachine.addListener(std::dynamic_pointer_cast<ls::std::core::IListener>(this->mercedes1));
|
|
|
- paintingMachine.addListener(std::dynamic_pointer_cast<ls::std::core::IListener>(this->mercedes2));
|
|
|
- paintingMachine.addListener(std::dynamic_pointer_cast<ls::std::core::IListener>(this->mercedes3));
|
|
|
+ paintingMachine.addListener(std::dynamic_pointer_cast<ls::std::core::interface::IListener>(this->mercedes1));
|
|
|
+ paintingMachine.addListener(std::dynamic_pointer_cast<ls::std::core::interface::IListener>(this->mercedes2));
|
|
|
+ paintingMachine.addListener(std::dynamic_pointer_cast<ls::std::core::interface::IListener>(this->mercedes3));
|
|
|
|
|
|
ASSERT_STREQ("pink", this->mercedes1->getColor().c_str());
|
|
|
ASSERT_STREQ("blue", this->mercedes2->getColor().c_str());
|