/// <summary> /// Add additional interfaces to the builder. /// </summary> /// <typeparam name="T">The proxy type.</typeparam> /// <param name="builder">The <see cref="IFakeOptions{T}"/>.</param> protected virtual void Build <T>(IFakeOptions <T> builder) { foreach (var i in this.additionalInterfaces) { builder.Implements(i); } }
public void BuildOptions(Type typeOfFake, IFakeOptions options) { var iqueryableInterfaceType = typeof(IQueryable <>); var idbAsyncEnumerableInterfaceType = typeof(IDbAsyncEnumerable <>); var genericClass = typeOfFake.GetGenericArguments().First(); var iqueryableTypeName = $"{iqueryableInterfaceType.FullName}[[{genericClass.AssemblyQualifiedName}]],{iqueryableInterfaceType.Assembly.FullName}"; var idbAsyncEnumerableTypeName = $"{idbAsyncEnumerableInterfaceType.FullName}[[{genericClass.AssemblyQualifiedName}]],{idbAsyncEnumerableInterfaceType.Assembly.FullName}"; var iqueryableType = Type.GetType(iqueryableTypeName, true, true); var idbAsyncEnumerableType = Type.GetType(idbAsyncEnumerableTypeName, true, true); options.Implements(iqueryableType); options.Implements(idbAsyncEnumerableType); }