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)); } }
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)); } }
public static T Get <T>(this TestContextHelper <T> helper, string testAttributeName, IFormatProvider formatProvider = null) => TestContextExtensions.Convert <T>(helper.TestContext.Get(testAttributeName), formatProvider);
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);