示例#1
0
 public static IEnumerable <T> GetMany <T>(this TestContextHelper <T> helper, string testAttributeName, IFormatProvider formatProvider = null)
 {
     foreach (var kvp in helper.TestContext.GetTestContextPropertiesStartsWith(testAttributeName))
     {
         yield return(TestContextExtensions.Convert <T>(kvp.Value, formatProvider));
     }
 }
示例#2
0
 public static IEnumerable <T2> GetMany <T1, T2>(this TestContextHelper <T1> helper, Expression <Func <T1, T2> > expression, IFormatProvider formatProvider = null)
 {
     foreach (var kvp in helper.TestContext.GetTestContextPropertiesStartsWith(expression.GetMemberName()))
     {
         yield return(TestContextExtensions.Convert <T2>(kvp.Value, formatProvider));
     }
 }
示例#3
0
 public static T Get <T>(this TestContextHelper <T> helper, string testAttributeName, IFormatProvider formatProvider = null)
 => TestContextExtensions.Convert <T>(helper.TestContext.Get(testAttributeName), formatProvider);
示例#4
0
 public static T2 Get <T1, T2>(this TestContextHelper <T1> helper, Expression <Func <T1, T2> > expression, IFormatProvider formatProvider = null)
 => TestContextExtensions.Convert <T2>(helper.TestContext.Get(expression.GetMemberName()), formatProvider);