This removes all of the (now actually non-trivial) conversion logic from the class which is actually responsible for executing the Jint engine. This moves it all to a new service which uses chain of responsibility to convert the result, using one of a few different mechanisms. Of note is the handling of ExpandoObject when no specific type information has been provided, and also the handling of enumerables, with the exception of strings.
9 lines
252 B
C#
9 lines
252 B
C#
using AutoFixture.Kernel;
|
|
|
|
namespace Elsa.Testing.Shared.AutoFixture.SpecimenBuilders
|
|
{
|
|
public static class SpecimenContextExtensions
|
|
{
|
|
public static T Resolve<T>(this ISpecimenContext context) => (T) context.Resolve(typeof(T));
|
|
}
|
|
} |