Hello,
I'm trying to create a Mock Controller and an instance of that type in order to pass it to my tested class. However, when the mocked method is called I get an Exception:
Test method GestionNet.UnitTesting.UnitTest1.TestDocConfigProvider threw exception: TypeMock.TypeMockException:
*** Method GetDecimales<TipoCalculadorDocDecimales> in type GestionNet.CalculadorDocConfigProvider has no matching overload that returns System.Int32..
The signature of the Method GetDecimales is:
public int GetDecimales(TipoCalculadorDocDecimales tipoDecimales)
And the code I'm using:
MockManager.Init();
MockObject MockDocConfig = MockManager.MockObject( typeof(CalculadorDocConfigProvider), Constructor.Mocked);
MockDocConfig.ExpectAndReturn("GetDecimales", 2, typeof(TipoCalculadorDocDecimales));
CalculadorDocConfigProvider docConfig = MockDocConfig.Object as CalculadorDocConfigProvider;
docConfig.GetDecimales(TipoCalculadorDocDecimales.Coste);
What I'm doing wrong? I can't understand why I get this exception.
Thanks,