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 6470959
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:10:12+00:00 2026-05-25T06:10:12+00:00

I feel like I have lost my mind because I am sure I have

  • 0

I feel like I have lost my mind because I am sure I have done this before. Hopefully one of you can point me in the right direction.

Essentially I have an view that I want to test that the presenter is correctly setting the property with a list of objects. Example:

public ComplexDto{
   public string name{get;set;}
   public string description{get;set;}
}

public interface ITestView{
 IList<ComplexDto> dto{get;set;}
}

Within the Presenter it sets a list like:

...
var dtos = new List<ComplexDto>();
dtos.add(new ComplexDto(){name="test name", description="this is some description"}
view.dto = dtos;
...

I need to test that that contents of the list of the dto work.

I have tried GetArgumentsForCallsMadeOn but I think this does not work with properties.

Thanks for any help!

  • 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-25T06:10:12+00:00Added an answer on May 25, 2026 at 6:10 am

    EDIT

    This should do it:

    var view = MockRepository.GenerateMock<ITestView>();
    var dtos = new List<ComplexDto>();
    dtos.Add(new ComplexDto() {name = "test name", description = "this is some description"});
    
    List<ComplexDto> passedIn;
    view.Expect(v => v.dto).SetPropertyWithArgument(dtos).WhenCalled(mi => passedIn = (List<ComplexDto>) mi.Arguments[0]);
    
    view.dto = dtos;
    view.VerifyAllExpectations();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I feel like this must have been asked before, but I've looked at Knockout
I feel like GUID/UUID questions have been done to death here, but I can't
I feel like this is quite delicate, I have various folders whith projects I
My one activity seems to have grown quite a bit and I feel like
I feel so lost trying to figure this out. I have my own data
I feel like I have enough experience with CI to finally start fooling around
I feel like I have everything I need in my routes.rb, my controller, and
I am pretty new to Haskell but I feel like I have a decent
I feel like I've entered the Twilight Zone. I have a Grails form that
I have a question that I just don't feel like I've found a satisfactory

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.