How to call moq VerifySet in VB.net

I am trying to verify that a property has been set, but when I write this as a unit test:

moqFeed.VerifySet(Function(m) m.RowAdded = "Row Added")

moq complains that "expression is not a setterter call"

My full code

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

I can not find moq examples in VB, I would appreciate any examples.

+3
source share
1 answer

See my question Using VerifySet Moq in VB.NET to resolve this issue.

+1
source

Source: https://habr.com/ru/post/1740586/


All Articles