Mocking Excel's Comment.Text() in c# with moq -
currently trying mock text() method excel's comment interface in c# moq. msdn link text()
my problem is, have call no parameters because want read content. when calling text() this: mockcomment.setup(m => m.text()).returns("test comment")
following error shown:
an expression tree may not contain call or invocation uses optional arguments
how can call text() moq can mock method?
i aware of question link problem not have parameters pass.
clr
not support calling methods optional arguments
either when arguments not provided explicitly
, since il-compiled code
c# compiler
inserts default values @ compile
time.
refer this, states underlying expression tree api
not support optional arguments
.
Comments
Post a Comment