TestBase.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. // ***********************************************************************
  2. // Copyright (c) 2017 Unity Technologies. All rights reserved.
  3. //
  4. // Licensed under the ##LICENSENAME##.
  5. // See LICENSE.md file in the project root for full license information.
  6. // ***********************************************************************
  7. using NUnit.Framework;
  8. using Autodesk.Fbx;
  9. using System.Collections.Generic;
  10. namespace Autodesk.Fbx.UnitTests
  11. {
  12. public abstract class TestBase<T>
  13. {
  14. /*
  15. * Helper to test a property getter without a compiler warning.
  16. * Use this like:
  17. * TestGetter(tex.Alpha);
  18. *
  19. * That will call get_Alpha under the hood, verifying that the getter
  20. * actually works. You can't just write
  21. * tex.Alpha;
  22. * because then you get a warning or error that your statement is
  23. * invalid.
  24. */
  25. public static void TestGetter<U>(U item) { /* we tested the getter by passing the argument! */ }
  26. #if ENABLE_COVERAGE_TEST
  27. [Test]
  28. public virtual void TestCoverage() { CoverageTester.TestCoverage(typeof(T), this.GetType()); }
  29. #endif
  30. }
  31. }