UiDynamicScrollBoxDataBusHandlerMock.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. #pragma once
  9. #include <AzCore/Component/Entity.h>
  10. #include <gmock/gmock.h>
  11. #include <LyShine/Bus/UiDynamicScrollBoxBus.h>
  12. // the following was generated using google's python script to autogenerate mocks.
  13. // however, it needed some hand-editing to make it work, so if you add functions to IRenderer,
  14. // it will probably be better to just manually add them here than try to run the script again
  15. // hand-edits are marked with 'hand-edit'. Everything else was autogenerated.
  16. using ::testing::_;
  17. class UiDynamicScrollBoxDataBusHandlerMock
  18. : public AZ::Component
  19. , public UiDynamicScrollBoxDataBus::Handler
  20. {
  21. public:
  22. AZ_COMPONENT(UiDynamicScrollBoxDataBusHandlerMock, "{5CBD9592-FD20-492B-BC24-4AEA8935AEA4}")
  23. // Just a mock object, no reflection necessary
  24. static void Reflect(AZ::ReflectContext*) {}
  25. void Activate() override
  26. {
  27. UiDynamicScrollBoxDataBus::Handler::BusConnect(GetEntityId());
  28. }
  29. void Deactivate() override
  30. {
  31. UiDynamicScrollBoxDataBus::Handler::BusDisconnect();
  32. }
  33. MOCK_METHOD0(GetNumElements, int ());
  34. MOCK_METHOD1(GetElementWidth, float (int));
  35. MOCK_METHOD1(GetElementHeight, float (int));
  36. MOCK_METHOD0(GetNumSections, int ());
  37. };