Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 925277
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T19:29:41+00:00 2026-05-15T19:29:41+00:00

I am trying to test that a property has been set but when I

  • 0

I am trying to test 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 property setter invocation”

My complete code is

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’t find any examples of moq in VB, I would be grateful for any examples.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T19:29:41+00:00Added an answer on May 15, 2026 at 7:29 pm

    See my question Using Moq's VerifySet in VB.NET for the solution to this.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to use mock to verify that an index property has been set.
I'm trying to Unit Test a class that has many internal functions. These obviously
I've been trying for a while now to write a unit test for a
I am trying to test the likelihood that a particular clustering of data has
Working with Test::Unit and Shoulda. Trying to test Users.create . My understanding is that
I'm trying to unit test a page in my ASP.NET MVC application that, when
I am trying to test that a particular method throws an expected exception from
I am trying to test a class that manages data access in the database
I'm trying to test a proposition that one of our vendors presented to us
Using TeamCity, I'm trying to get a (TestAutomationFX) test that requires an STA thread

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.