mpha...@gmail.com
unread,Aug 26, 2008, 2:41:39 PM8/26/08Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Moq Discussions
I've not mocked at all before and am trying to learn how to get a
simple test working with a Sub in VB (same as void in C#).
If I change the lamba to call Save instead of Insert this error goes
away and everything works fine. Can anyone help me?
Here's the error "Expression does not produce a value.":
Error 1 Overload resolution failed because no accessible 'Expect' can
be called with these arguments:
'Public Function Expect(Of TResult)(expression As
System.Linq.Expressions.Expression(Of System.Func(Of
CSDALC.IManagerBase(Of CSDALC.PolHDAL, CSDALC.PolHDALCollection),
TResult))) As Moq.Language.Flow.IExpect(Of TResult)': Expression does
not produce a value.
'Public Function Expect(Of TResult)(expression As
System.Linq.Expressions.Expression(Of System.Func(Of
CSDALC.IManagerBase(Of CSDALC.PolHDAL, CSDALC.PolHDALCollection),
TResult))) As Moq.Language.Flow.IExpect(Of TResult)': Data type(s) of
the type parameter(s) cannot be inferred from these arguments.
Specifying the data type(s) explicitly might correct this error.
'Public Function Expect(expression As
System.Linq.Expressions.Expression(Of System.Action(Of
CSDALC.IManagerBase(Of CSDALC.PolHDAL, CSDALC.PolHDALCollection)))) As
Moq.Language.Flow.IExpect': Expression does not produce a value. C:\...
\Visual Studio 2008\Projects\CS\CSBLUnitTests\PolHTest.vb 72 9
CSBLUnitTests
Option Infer On
Public Interface IManagerBase(Of t, tColl As {SortedBindingList(Of t),
New})
Sub Insert(ByRef inObject As t)
Function Load(ByVal id As Integer) As t
Function Save(ByVal inObject As t) As Integer
Function Delete(ByVal inObject As t) As Integer
End Interface
Dim mockDataAccessManager As New Mock(Of IManagerBase(Of PolhDAL,
polhDALCollection))
Dim target As Polh_Accessor = New Polh_Accessor
Dim polh As New PolhDAL
MockDataAccessManager.Expect(Function(x) x.Insert(polh))