CustomSerializeContextTestFixture.cpp 1.0 KB

12345678910111213141516171819202122232425262728
  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 <CustomSerializeContextTestFixture.h>
  9. namespace UnitTest
  10. {
  11. void CustomSerializeContextTestFixture::SetUp()
  12. {
  13. LeakDetectionFixture::SetUp();
  14. m_serializeContext = AZStd::make_unique<AZ::SerializeContext>();
  15. m_componentApplicationMock = AZStd::make_unique<testing::NiceMock<MockComponentApplication>>();
  16. ON_CALL(*m_componentApplicationMock.get(), GetSerializeContext()).WillByDefault(::testing::Return(m_serializeContext.get()));
  17. ON_CALL(*m_componentApplicationMock.get(), AddEntity(::testing::_)).WillByDefault(::testing::Return(true));
  18. }
  19. void CustomSerializeContextTestFixture::TearDown()
  20. {
  21. m_componentApplicationMock.reset();
  22. m_serializeContext.reset();
  23. LeakDetectionFixture::TearDown();
  24. }
  25. } // namespace UnitTest