1
Answer

Writing test case for static method with linq in moq

kamila

kamila

6y
975
1
Hi , Am new to mock test, am trying to write a test case for the follwing method could shed some light of checking the collection in a simple through mock .And this is static method.
 
  1. ACollection obj = (ACollection)aCollection.Filter();  
  2.                var result = aCollection.Where(a => a.IsConditionEvaluatedAndTrue())  
  3.                   .Select(arg =>  
  4.                   new KeyValuePair<int, WebArg>(arg.Key,  
  5.                       new WebArg(arg) { IsConditionTrue = true }))  
  6.                   .OrderByDescending(pair =>  
  7.                   WebArg.MapAllSupportLevelsToNumeric(pair.Value.VerboseArgumentLevel))  
  8.                   .ToDictionary(pair => pair.Key, pair => pair.Value);  
  9.                return result;  
 
Answers (1)