AssertionComponentExt.cs 516 B

12345678910111213141516171819202122
  1. using System;
  2. using System.Linq;
  3. namespace UnityTest
  4. {
  5. public static class AssertionComponentExt
  6. {
  7. public static Type GetFirstArgumentType (this AssertionComponent assertion)
  8. {
  9. return assertion.Action.GetParameterType();
  10. }
  11. public static Type GetSecondArgumentType(this AssertionComponent assertion)
  12. {
  13. Type secondArgument = null;
  14. if (assertion.Action is ComparerBase)
  15. {
  16. secondArgument = (assertion.Action as ComparerBase).GetSecondParameterType();
  17. }
  18. return secondArgument;
  19. }
  20. }
  21. }