MockPaintBrushNotificationHandler.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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/Serialization/SerializeContext.h>
  10. #include <AzCore/UnitTest/TestTypes.h>
  11. #include <AzTest/AzTest.h>
  12. #include <AzFramework/PaintBrush/PaintBrush.h>
  13. #include <AZTestShared/Math/MathTestHelpers.h>
  14. namespace UnitTest
  15. {
  16. class MockPaintBrushNotificationBusHandler : public AzFramework::PaintBrushNotificationBus::Handler
  17. {
  18. public:
  19. MockPaintBrushNotificationBusHandler(const AZ::EntityComponentIdPair& entityComponentIdPair)
  20. {
  21. AzFramework::PaintBrushNotificationBus::Handler::BusConnect(entityComponentIdPair);
  22. }
  23. ~MockPaintBrushNotificationBusHandler() override
  24. {
  25. AzFramework::PaintBrushNotificationBus::Handler::BusDisconnect();
  26. }
  27. MOCK_METHOD0(OnPaintModeBegin, void());
  28. MOCK_METHOD0(OnPaintModeEnd, void());
  29. MOCK_METHOD1(OnBrushStrokeBegin, void(const AZ::Color& color));
  30. MOCK_METHOD0(OnBrushStrokeEnd, void());
  31. MOCK_METHOD4(OnPaint, void(const AZ::Color& color, const AZ::Aabb& dirtyArea, ValueLookupFn& valueLookupFn, BlendFn& blendFn));
  32. MOCK_CONST_METHOD1(OnGetColor, AZ::Color(const AZ::Vector3& brushCenterPoint));
  33. MOCK_METHOD5(OnSmooth, void(
  34. const AZ::Color& color,
  35. const AZ::Aabb& dirtyArea,
  36. ValueLookupFn& valueLookupFn,
  37. AZStd::span<const AZ::Vector3> valuePointOffsets,
  38. SmoothFn& smoothFn));
  39. };
  40. } // namespace UnitTest