ActiveSceneProviderTests.cs 970 B

1234567891011121314151617181920212223242526272829303132
  1. using NUnit.Framework;
  2. using UnityEngine.SceneManagement;
  3. using UnityEditor.SceneManagement;
  4. using LLM.Editor.Analysis;
  5. namespace LLM.Editor.Tests.Unit
  6. {
  7. [TestFixture]
  8. public class ActiveSceneProviderTests
  9. {
  10. [Test]
  11. public void GetContext_ReturnsCorrectInfoForActiveScene()
  12. {
  13. // Arrange
  14. var provider = new ActiveSceneProvider();
  15. // Act
  16. var context = provider.GetContext(null, null);
  17. // Assert
  18. Assert.IsInstanceOf<ActiveSceneProvider.SceneInfo>(context);
  19. var sceneInfo = (ActiveSceneProvider.SceneInfo)context;
  20. // The name of a new, unsaved scene is empty
  21. Assert.AreEqual(string.Empty, sceneInfo.name);
  22. Assert.AreEqual(string.Empty, sceneInfo.path);
  23. Assert.IsTrue(sceneInfo.isValid);
  24. // A new scene is not dirty by default
  25. Assert.IsFalse(sceneInfo.isDirty);
  26. }
  27. }
  28. }