我正在尝试测试已设置属性但是当我将其作为单元测试编写时:
moqFeed.VerifySet(Function(m) m.RowAdded = "Row Added")
moq抱怨“表达式不是属性设置器调用”
我的完整代码是
Imports Gallio.Framework
Imports MbUnit.Framework
Imports Moq
<TestFixture()> Public Class GUI_FeedPresenter_Test
Private moqFeed As Moq.Mock(Of IFeedView)
<SetUp()> Sub Setup()
moqFeed = New Mock(Of IFeedView)
End Sub
<Test()> Public Sub New_Presenter()
Dim pres = New FeedPresenter(moqFeed.Object)
moqFeed.VerifySet(Function(m) m.RowAdded = "Row Added")
End Sub
End Class
Public Interface IFeedView
Property RowAdded() As String
End Interface
Public Class FeedPresenter
Private _FeedView As IFeedView
Public Sub New(ByVal feedView As IFeedView)
_FeedView = feedView
_FeedView.RowAdded = "Row Added"
End Sub
End Class
我在VB中找不到moq的任何例子,我将不胜感激任何例子。