Ceri Lewis
unread,Jun 11, 2008, 6:50:38 AM6/11/08Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Rhino.Mocks
Using Rhino Mocks 3.4
I have the following in a test method:
// Setup the mock objects
MockRepository mocks = new MockRepository();
IDeliveryPeriodConverterFactory
deliveryPeriodConverterFactory =
mocks.CreateMock<IDeliveryPeriodConverterFactory>();
*** IRangeExtractor rangeExtractor =
mocks.CreateMock<IRangeExtractor>();
IDataBlockExtractor dataBlockExtractor =
mocks.CreateMock<IDataBlockExtractor>();
When executing the line with *** I get the following:
System.TypeLoadException: Method 'ExtractRanges' in type
'IRangeExtractorProxyb07f490417024a5fb04a8dc0a2cbaa1d' from assembly
'DynamicProxyGenAssembly2, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=a621a9e7e5c32e69' does not have an implementation..
The IRangeExtractor interface is defined as:
/// <summary>
/// Interface for extracting ranges from a data array.
/// </summary>
public interface IRangeExtractor
{
/// <summary>
/// Extract data ranges from the specified array. Return
/// any warnings in the list of strings.
/// </summary>
/// <param name="data">Array of <b>Object</b>s to extract the
ranges from</param>
/// <param name="dataRanges">List to store the data ranges in</
param>
/// <param name="dateRanges">List to store the date ranges in</
param>
/// <param name="warnings">List to hold any warning messages</
param>
void ExtractRanges(
Object[,] data,
IList<IDataRange> dataRanges,
IList<IDateRange> dateRanges,
IList<String> warnings);
}
IDataRange & IDateRange just have a few getter properties on them.
Any ideas what the probelm could be?
Thanks
Stack trace:
at System.Reflection.Emit.TypeBuilder._TermCreateClass(Int32
handle, Module module)
at System.Reflection.Emit.TypeBuilder.CreateTypeNoLock()
at System.Reflection.Emit.TypeBuilder.CreateType()
at
Castle.DynamicProxy.Generators.Emitters.AbstractTypeEmitter.BuildType()
at
Castle.DynamicProxy.Generators.InterfaceProxyWithTargetGenerator.GenerateCode(Type
proxyTargetType, Type[] interfaces, ProxyGenerationOptions options)
at
Castle.DynamicProxy.DefaultProxyBuilder.CreateInterfaceProxyTypeWithoutTarget(Type
theInterface, Type[] interfaces, ProxyGenerationOptions options)
at
Castle.DynamicProxy.ProxyGenerator.CreateInterfaceProxyTypeWithoutTarget(Type
theInterface, Type[] interfaces, ProxyGenerationOptions options)
at
Castle.DynamicProxy.ProxyGenerator.CreateInterfaceProxyWithoutTarget(Type
theInterface, Type[] interfaces, ProxyGenerationOptions options,
IInterceptor[] interceptors)
at
Castle.DynamicProxy.ProxyGenerator.CreateInterfaceProxyWithoutTarget(Type
theInterface, Type[] interfaces, IInterceptor[] interceptors)
at Rhino.Mocks.MockRepository.MockInterface(CreateMockState
mockStateFactory, Type type, Type[] extras)
at Rhino.Mocks.MockRepository.CreateMockObject(Type type,
CreateMockState factory, Type[] extras, Object[]
argumentsForConstructor)
at Rhino.Mocks.MockRepository.CreateMock[T](Object[]
argumentsForConstructor)