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

  • SEARCH
  • Home
  • 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 6065803
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:25:54+00:00 2026-05-23T09:25:54+00:00

OK – So, I have been trying to search for this but I probably

  • 0

OK – So, I have been trying to search for this but I probably have my understanding (and hence wording) of the question wrong so I will do my best to explain and hopefully someone can make sense of what I need to do and point me in the right direction – here goes.

I have a view model, the view model takes and adapter which I mock – no problem there, but the asserts I want to write are going to check that setting certain properties of the view model updated certain properties of an object that is itself a property of the adapter. I understand how to use setup to say anytime a method is called return “X” but this isn’t a method, it’s a property and I am stumped – seems like it outta be simple.

Here is some code from the view model that gives you an idea of what I am doing.

public bool OnlyUseFedEx
{
  get { return vendorQualitativeMetricsAdapter.VendorQualitativeMetric.OnlyUseFedEx; }
  set { vendorQualitativeMetricsAdapter.VendorQualitativeMetric.OnlyUseFedEx = value; }
}

Here is what I started with the test method

    [TestMethod]
public void VQM_ShippingViewModel_Can_Update_Adapters_vendorManagementProxy()
{
  var vendorManagementProxy = new VendorManagementProxy();
  var vqmAdapter = new Mock<IVendorQualitativeMetricsAdapter>();
  //This is where I would like to say - always return that vendorManagementProxy object I created. 
  vqmAdapter.Setup(a => a.VendorQualitativeMetric ???
  ShippingViewModel shippingViewModel;
}

OK – Thanks…

  • 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-23T09:25:55+00:00Added an answer on May 23, 2026 at 9:25 am

    Can’t you just use Returns on the Setup call? Maybe I misunderstood the question though…

    vqmAdapter.Setup(a => a.VenderQualitativeMetric).Returns(venderManagementProxy)
    

    this is a good place to start looking for MoQ tips and tricks 🙂

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

Sidebar

Related Questions

This could be a duplicate question, but I have no idea what search terms
Have a webpage that will be viewed by mainly IE users, so CSS3 is
i have this code: <?php $valid_ext = array(pdf, doc); $args = array( 'post_type' =>
Possible Duplicate: replace all occurrences in a string I found this question/answer: Use JavaScript
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
My NSXMLParser breaks on this string: <title>AAA &#8211; BCDEFGQWERTYUIO</title> I parsed it in this
I don't have much knowledge about the IPv6 protocol, so sorry if the question
So to start, I have an array of XML files. These files need to
I'm trying to craft a Java regular expression to split strings of the general
I have a simple restful service that transforms a JAXB-anntotated beans to response XML

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.