No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

IPrebuildSceneSetup.cs 2.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. namespace UnityEngine.TestTools
  2. {
  3. /// <summary>
  4. /// Implement this interface if you want to define a set of actions to run as a pre-build step.
  5. /// </summary>
  6. public interface IPrebuildSetup
  7. {
  8. /// <summary>
  9. /// Implement this method to call actions automatically before the build process.
  10. /// </summary>
  11. /// <example>
  12. /// <code>
  13. /// [TestFixture]
  14. /// public class CreateSpriteTest : IPrebuildSetup
  15. /// {
  16. /// Texture2D m_Texture;
  17. /// Sprite m_Sprite;
  18. ///
  19. /// public void Setup()
  20. /// {
  21. /// #if UNITY_EDITOR
  22. /// var spritePath = "Assets/Resources/Circle.png";
  23. ///
  24. /// var ti = UnityEditor.AssetImporter.GetAtPath(spritePath) as UnityEditor.TextureImporter;
  25. ///
  26. /// ti.textureCompression = UnityEditor.TextureImporterCompression.Uncompressed;
  27. ///
  28. /// ti.SaveAndReimport();
  29. /// #endif
  30. /// }
  31. ///
  32. /// [SetUp]
  33. /// public void SetUpTest()
  34. /// {
  35. /// m_Texture = Resources.Load&lt;Texture2D&gt;("Circle");
  36. /// }
  37. ///
  38. /// [Test]
  39. /// public void WhenNullTextureIsPassed_CreateShouldReturnNullSprite()
  40. /// {
  41. /// // Check with Valid Texture.
  42. ///
  43. /// LogAssert.Expect(LogType.Log, "Circle Sprite Created");
  44. ///
  45. /// Sprite.Create(m_Texture, new Rect(0, 0, m_Texture.width, m_Texture.height), new Vector2(0.5f, 0.5f));
  46. ///
  47. /// Debug.Log("Circle Sprite Created");
  48. ///
  49. /// // Check with NULL Texture. Should return NULL Sprite.
  50. /// m_Sprite = Sprite.Create(null, new Rect(0, 0, m_Texture.width, m_Texture.height), new Vector2(0.5f, 0.5f));
  51. ///
  52. /// Assert.That(m_Sprite, Is.Null, "Sprite created with null texture should be null");
  53. /// }
  54. /// }
  55. /// </code>
  56. /// </example>
  57. void Setup();
  58. }
  59. }