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...