public void GetParameters_Handles_Input_Params() { var target = new AccountRequestProcessor <Account>(); Expression <Func <Account, bool> > expression = acct => acct.Type == AccountType.Settings && acct.SkipStatus == true && acct.IncludeEntities == true && acct.IncludeEmail == true; var lambdaExpression = expression as LambdaExpression; var queryParams = target.GetParameters(lambdaExpression); Assert.IsTrue( queryParams.Contains( new KeyValuePair <string, string>("Type", ((int)AccountType.Settings).ToString(CultureInfo.InvariantCulture)))); Assert.IsTrue( queryParams.Contains( new KeyValuePair <string, string>("SkipStatus", "True"))); Assert.IsTrue( queryParams.Contains( new KeyValuePair <string, string>("IncludeEntities", "True"))); Assert.IsTrue( queryParams.Contains( new KeyValuePair <string, string>("IncludeEmail", "True"))); }
public void GetParametersTest() { AccountRequestProcessor <Account> target = new AccountRequestProcessor <Account>(); Expression <Func <Account, bool> > expression = acct => acct.Type == AccountType.RateLimitStatus; LambdaExpression lambdaExpression = expression as LambdaExpression; var queryParams = target.GetParameters(lambdaExpression); Assert.IsTrue( queryParams.Contains( new KeyValuePair <string, string>("Type", ((int)AccountType.RateLimitStatus).ToString()))); }
public void GetParameters_Handles_Input_Params() { var target = new AccountRequestProcessor<Account>(); Expression<Func<Account, bool>> expression = acct => acct.Type == AccountType.Settings && acct.SkipStatus == true && acct.IncludeEntities == true; var lambdaExpression = expression as LambdaExpression; var queryParams = target.GetParameters(lambdaExpression); Assert.True( queryParams.Contains( new KeyValuePair<string, string>("Type", ((int)AccountType.Settings).ToString(CultureInfo.InvariantCulture)))); Assert.True( queryParams.Contains( new KeyValuePair<string, string>("SkipStatus", "True"))); Assert.True( queryParams.Contains( new KeyValuePair<string, string>("IncludeEntities", "True"))); }
public void GetParametersTest() { AccountRequestProcessor<Account> target = new AccountRequestProcessor<Account>(); Expression<Func<Account, bool>> expression = acct => acct.Type == AccountType.RateLimitStatus; LambdaExpression lambdaExpression = expression as LambdaExpression; var queryParams = target.GetParameters(lambdaExpression); Assert.IsTrue( queryParams.Contains( new KeyValuePair<string, string>("Type", ((int)AccountType.RateLimitStatus).ToString()))); }