CanAddActor.cpp 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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 <gtest/gtest.h>
  9. #include <QPushButton>
  10. #include <QAction>
  11. #include <QtTest>
  12. #include <Tests/UI/UIFixture.h>
  13. #include <Tests/TestAssetCode/JackActor.h>
  14. #include <Tests/TestAssetCode/TestActorAssets.h>
  15. #include <EMotionFX/CommandSystem/Source/CommandManager.h>
  16. #include <EMotionFX/Source/Actor.h>
  17. #include <EMotionFX/Source/ActorManager.h>
  18. namespace EMotionFX
  19. {
  20. TEST_F(UIFixture, CanAddActor)
  21. {
  22. /*
  23. Test Case: C14459474
  24. Can Add Actor
  25. Imports an Actor to ensure that importing an actor is poosible.
  26. */
  27. RecordProperty("test_case_id", "C14459474");
  28. // Ensure that the number of actors loaded is 0
  29. ASSERT_EQ(GetActorManager().GetNumActors(), 0);
  30. // Load an Actor
  31. AZ::Data::AssetId actorAssetId("{5060227D-B6F4-422E-BF82-41AAC5F228A5}");
  32. AZ::Data::Asset<Integration::ActorAsset> actorAsset =
  33. TestActorAssets::CreateActorAssetAndRegister<JackNoMeshesActor>(actorAssetId, "Jack");
  34. // Ensure the Actor is correct
  35. ASSERT_TRUE(GetActorManager().FindActorByName("Jack"));
  36. EXPECT_EQ(GetActorManager().GetNumActors(), 1);
  37. }
  38. } // namespace EMotionFX