LandscapeCanvasPythonBindingsTest.cpp 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #include <AzCore/Component/ComponentApplication.h>
  9. #include <AzCore/Component/Entity.h>
  10. #include <AzCore/RTTI/BehaviorContext.h>
  11. #include <AzCore/Serialization/SerializeContext.h>
  12. #include <AzTest/AzTest.h>
  13. #include <AzCore/UnitTest/TestTypes.h>
  14. #include <Source/LandscapeCanvasSystemComponent.h>
  15. class LandscapeCanvasPythonBindingsFixture
  16. : public ::testing::Test
  17. {
  18. protected:
  19. void SetUp() override
  20. {
  21. AZ::ComponentApplication::Descriptor appDesc;
  22. m_application.Create(appDesc);
  23. m_application.RegisterComponentDescriptor(LandscapeCanvas::LandscapeCanvasSystemComponent::CreateDescriptor());
  24. }
  25. void TearDown() override
  26. {
  27. m_application.Destroy();
  28. }
  29. AZ::ComponentApplication m_application;
  30. };
  31. TEST_F(LandscapeCanvasPythonBindingsFixture, LandscapeCanvasNodeFactoryRequests_ApiExists)
  32. {
  33. AZ::BehaviorContext* behaviorContext(nullptr);
  34. AZ::ComponentApplicationBus::BroadcastResult(behaviorContext, &AZ::ComponentApplicationRequests::GetBehaviorContext);
  35. ASSERT_TRUE(behaviorContext);
  36. auto nodeFactoryRequestBus = behaviorContext->m_ebuses.find("LandscapeCanvasNodeFactoryRequestBus");
  37. EXPECT_TRUE(behaviorContext->m_ebuses.end() != nodeFactoryRequestBus);
  38. auto landscapeCanvasRequestBus = behaviorContext->m_ebuses.find("LandscapeCanvasRequestBus");
  39. EXPECT_TRUE(behaviorContext->m_ebuses.end() != landscapeCanvasRequestBus);
  40. }