It is necessary to check the implementation of the virtual method "MyMethod" in the abstract "MyAbstractClass":
public abstract MyAbstractClass { public void MyMethod() { Testpassed = true; } public abstract int StatusCode{get;internal set;}
I tried to do the following:
[TestMethod()] { Mock<MyAbstractClass> mockClass = new Mock<MyAbstractClass>(); mockClass.Object.MyMethod(); Assert.IsTrue(mockClass.Object.TestPassed); }
when trying to execute 'MyMethod' the following error is generated:
The method 'set_StatusCode' in type 'MyAbstractClass`2Proxy0434d60c0f4542fb9b4667ead4ca3a18' from the assembly 'DynamicProxyGenAssembly2 ", Version = 0.0.0.0, Culture = neutral, PublicKeyToken = null' has no implementation ..
Please advise how can I solve the problem?
Thank you so much!
PS Actually, I could inherit from MyAbstractClass and provide the implementation of the 'StatusCode' property, but I have a bunch of properties that will be implemented ...
Budda Aug 30 '10 at 22:31 2010-08-30 22:31
source share