CreateSpinningCubeTest.cs 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. using LLM.Editor.Data;
  2. using Newtonsoft.Json.Linq;
  3. using JetBrains.Annotations;
  4. using System.Collections.Generic;
  5. namespace LLM.Editor.Tests.Integration
  6. {
  7. [UsedImplicitly]
  8. public class CreateSpinningCubeTest : IDummyTestCase
  9. {
  10. public string TriggerPhrase => "Create a spinning cube";
  11. public List<List<CommandData>> GetCommandSteps()
  12. {
  13. var step1 = new List<CommandData>
  14. {
  15. new()
  16. {
  17. commandName = "UpdateWorkingContextCommand",
  18. jsonData = new JObject
  19. {
  20. ["updates"] = new JObject
  21. {
  22. ["plan"] = new JArray(
  23. "Create a new Cube GameObject named 'SpinningCube'.",
  24. "Create a new C# script named 'Spinner'.",
  25. "Attach the 'Spinner' script to the 'SpinningCube'."
  26. )
  27. }
  28. }
  29. },
  30. new()
  31. {
  32. commandName = "CreateGameObjectCommand",
  33. jsonData = new JObject
  34. {
  35. ["gameObjectName"] = "SpinningCube",
  36. ["logicalName"] = "TestCube_1",
  37. ["primitiveType"] = "Cube"
  38. }
  39. },
  40. new()
  41. {
  42. commandName = "CreateAssetCommand",
  43. jsonData = new JObject
  44. {
  45. ["assetType"] = "Script",
  46. ["assetName"] = "Spinner",
  47. ["logicalName"] = "TestSpinnerScript_1",
  48. ["content"] = "using UnityEngine; public class Spinner : MonoBehaviour { public float speed = 50f; void Update() { transform.Rotate(Vector3.up, speed * Time.deltaTime); } }"
  49. }
  50. },
  51. new()
  52. {
  53. commandName = "AddComponentToAssetCommand",
  54. jsonData = new JObject
  55. {
  56. ["targetIdentifier"] = "TestCube_1",
  57. ["scriptName"] = "Spinner"
  58. }
  59. }
  60. };
  61. return new List<List<CommandData>> { step1 };
  62. }
  63. }
  64. }