PrefabAssetPathChangeTestFixture.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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 <Prefab/PrefabTestFixture.h>
  10. namespace UnitTest
  11. {
  12. using namespace AzToolsFramework::Prefab;
  13. //! Fixture for testing prefab source asset file and path changes
  14. class PrefabAssetPathChangeTestFixture
  15. : public PrefabTestFixture
  16. {
  17. protected:
  18. void SetUpEditorFixtureImpl() override;
  19. InstanceOptionalReference CreatePrefabInstance(AZStd::string_view folderPath, AZStd::string_view fileName);
  20. void ChangePrefabFolderPath(AZStd::string_view fromFolderPath, AZStd::string_view toFolderPath);
  21. void ChangePrefabFileName(
  22. AZStd::string_view folderPath,
  23. AZStd::string_view fromFileName,
  24. AZStd::string_view toFileName);
  25. AZ::IO::Path GetPrefabFilePathForSerialization(AZStd::string_view folderPath, AZStd::string_view fileName);
  26. private:
  27. void SendFolderPathNameChangeEvent(AZStd::string_view fromPath, AZStd::string_view toPath);
  28. void SendFilePathNameChangeEvent(AZStd::string_view fromPath, AZStd::string_view toPath);
  29. AZ::IO::Path GetAbsoluteFilePathName(AZStd::string_view folderPath, AZStd::string_view fileName);
  30. // Private members
  31. AZStd::string m_projectPath;
  32. };
  33. }