MapperConfigurationTestContainer.cs 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. using Masuit.Tools.Mapping.Core;
  2. using System;
  3. using System.Linq.Expressions;
  4. using System.Reflection;
  5. namespace Masuit.Tools.UnitTest.Mapping.ClassTests
  6. {
  7. public class MapperConfigurationTestContainer : MapperConfiguration<ClassSource, ClassDest>
  8. {
  9. public MapperConfigurationTestContainer() : base("sTest")
  10. {
  11. }
  12. public int GetIgnoreCount()
  13. {
  14. return PropertiesToIgnore.Count;
  15. }
  16. public int GetAfterMapActionCount()
  17. {
  18. return actionsAfterMap.Count;
  19. }
  20. public MapperConfigurationBase GetMapperTest(Type tSource, Type tDest, bool throwExceptionOnNoFound)
  21. {
  22. return GetMapper(tSource, tDest, throwExceptionOnNoFound);
  23. }
  24. public void CheckAndConfigureMappingTest(Tuple<Expression, Expression, bool, string> configExpression)
  25. {
  26. CheckAndConfigureMapping(ref configExpression);
  27. }
  28. public PropertyInfo GetPropertyInfoTest(LambdaExpression expression)
  29. {
  30. return GetPropertyInfo(expression);
  31. }
  32. public void CreateCommonMemberTest()
  33. {
  34. CreateCommonMember();
  35. }
  36. public void CheckAndRemoveMemberDestTest(string propertyName)
  37. {
  38. CheckAndRemoveMemberDest(propertyName);
  39. }
  40. public void CreateMemberAssignementForExistingTargetTest()
  41. {
  42. CreateMemberAssignementForExistingTarget();
  43. }
  44. public Delegate GetDelegateForExistingTargetTest()
  45. {
  46. return GetDelegateForExistingTarget();
  47. }
  48. }
  49. }