I have a unit test which has the line:
Isolate.Verify.WasNotCalled(() => VehicleParameters.spVMLSetVehicleChangeExpectedValue(null));
The spVMLSetVehicleChangeExpectedValue is being called once in the whole dll project
I have an internal servicehelper.cs which is visible to the test project by assemblyinfo([assembly: InternalsVisibleTo("Test.GRT.VML")])
Even if I write:
If(false)
VehicleParameters.spVMLSetVehicleChangeExpectedValue(vclParameters)
The “WasNotCalled” function returns:
Error:
Test method Test.GRT.VML.TestService.SetVehicleParameter_ArrayWithUnitParametersOnly_CentralDBWasNotCalled threw exception:
TypeMock.VerifyException:
TypeMock Verification: Method GRT.VML.DAL.VehicleParameters.GetVehicleUnitIds(Int32[]) was called unexpectedly
Stack:
ef.a(i3 A_0, aa A_1, hd A_2, Predicate`1 A_3)
b3.c(Delegate A_0)
b3.WasNotCalled[T](Func`1 func)
Test.GRT.VML.TestService.SetVehicleParameter_ArrayWithUnitParametersOnly_CentralDBWasNotCalled() in C:GreenroadTechSharedAssembliesMainGRT.VMLTest.GRT.VMLTestService.cs: line 235
TypeMock.MockManager.a(String A_0, String A_1, Object A_2, Object A_3, Boolean A_4, Boolean A_5, Object[] A_6)
TypeMock.InternalMockManager.getReturn(Object that, String typeName, String methodName, Object methodParameters, Boolean isInjected, Boolean isInterceptedType)
Test.GRT.VML.TestService.SetVehicleParameter_ArrayWithUnitParametersOnly_CentralDBWasNotCalled() in C:GreenroadTechSharedAssembliesMainGRT.VMLTest.GRT.VMLTestService.cs: line 195
THNX
Alon