You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
trying to setup setter for a property of ISymbol type, which is COM interface:
ISymbol setSymbol = null;
elMock.SetupGet(e => e.Symbol).Returns(setSymbol);
elMock.SetupSet(e => e.Symbol = It.IsAny()).Callback(s => setSymbol = s);
set it during a test:
el.Symbol = (ISymbol)Com.CreateInstance();
this never works, setSymbol stays null, Symbol property also always returns null
The text was updated successfully, but these errors were encountered:
That's because you configured it to return null. At the moment when .Returns(setSymbol) executes, setSymbol is null, therefore that call is equivalent to .Returns(null). Did you perhaps mean:
elMock.SetupGet(e => e.Symbol).Returns(()=> setSymbol);// deferred evaluation using lambda
typeof(TValue).IsAssignableFrom(value.GetType()) might indeed not work for a COM object. This could apparently be solved by changing the test to value is TValue.
trying to setup setter for a property of ISymbol type, which is COM interface:
ISymbol setSymbol = null;
elMock.SetupGet(e => e.Symbol).Returns(setSymbol);
elMock.SetupSet(e => e.Symbol = It.IsAny()).Callback(s => setSymbol = s);
set it during a test:
el.Symbol = (ISymbol)Com.CreateInstance();
this never works, setSymbol stays null, Symbol property also always returns null
The text was updated successfully, but these errors were encountered: