示例#1
0
 public override IEnumerable<BaseTestCase> GetNextStep(IDictionary<Type, GenerationOutput> outputs, out IEnumerable<ConfigureSignature> suspectedMethods)
 {
     var output = outputs[_type];
     if (output.Generated.Count != 0 || output.Exception != null)
     {
         return MethodTestCase.CreateMethodTestCase(_type, _priority, _methods, out suspectedMethods);
     }
     else
     {
         suspectedMethods = Enumerable.Empty<ConfigureSignature>();
         return Enumerable.Empty<BaseTestCase>();
     }
 }
 /// <summary>
 /// Creates the tests case to analyze a list of priority.
 /// Must be used only if you are sure the type have dependent methods
 /// </summary>
 /// <param name="type">Type to analyze</param>
 /// <param name="priorities">Priorities to analyze</param>
 /// <param name="suspectedMethods">[out] the methods suspected before the first iteration</param>
 /// <returns>a list of test case to execute</returns>
 public static IEnumerable <BaseTestCase> CreatePriorityTestCase(
     Type type,
     IEnumerable <KeyValuePair <ConfigurePriority, IEnumerable <string> > > priorities,
     out IEnumerable <ConfigureSignature> suspectedMethods)
 {
     if (priorities.Count() > 1)
     {
         // if there is more than one priority we can't suspect anything
         suspectedMethods = Enumerable.Empty <ConfigureSignature>();
         return(priorities.Select(priority => new PriorityTestCase(type, priority.Key, priority.Value)));
     }
     else
     {
         var priority = priorities.First();
         return(MethodTestCase.CreateMethodTestCase(type, priority.Key, priority.Value, out suspectedMethods));
     }
 }
 public void GetMethodSignature(MethodTestCase input)
 {
     var methodBase = ReflectionHelper.GetMethodInfo(input.Method);
     Assert.That(ReflectionHelper.GetMethodSignature(methodBase, true), Is.EqualTo(input.MethodSignature));
 }