/// <summary> /// Creates a new dynamic mock of the specified type. /// </summary> /// <typeparam name="TMockedType">The type to mock.</typeparam> /// <param name="constructorArgs">The arguments for the constructor of the class to be mocked. /// Only applicable when mocking classes with non-default constructors.</param> /// <returns>A dynamic mock for the specified type.</returns> public TMockedType CreateInstance <TMockedType>(params object[] constructorArgs) { return(CreateInstance <TMockedType>(DefinedAs.WithArgs(constructorArgs))); }
/// <summary> /// Creates a <see cref="Mock{T}"/> with the specified constructor arguments. /// </summary> /// <typeparam name="T">The type of mock to create.</typeparam> /// <param name="constructorArguments"></param> /// <returns></returns> public Mock <T> CreateMock <T>(params object[] constructorArguments) where T : class { return(CreateMock <T>(DefinedAs.WithArgs(constructorArguments))); }