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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:14:04+00:00 2026-05-23T12:14:04+00:00

I currently have an event trigger firing a custom trigger action. The action passes

  • 0

I currently have an event trigger firing a custom trigger action.

The action passes back a EventArgs type of object to the view’s view-model.

This is all well and good when I run the code it works perfectly. However, when I come to test this portion of code it all goes a bit rubbish.

As stated We are using an MVVM type pattern so I’m testing the ‘Doing’ end of the event trigger in my view-model and what I want to do is create a ‘mocked’ EventArgs object to pass into the execute method of my command under test. However it requires a RoutedEvent as it’s ID property as stated above and I don’t have access to it’s constructor!

Cannot Access Internal Constructor for 'RoutedEvent' here.

Has anyone got any ideas? The code converage in test is more important than the current implimentation so if this is thought to be ‘untestable’, then I can make changes.

  • 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-23T12:14:04+00:00Added an answer on May 23, 2026 at 12:14 pm

    I have answered my own Question I think.

    Casting the object passed back from the view at an earlier point means that the object I am passing to the methods under test is more easily created.

    This is what I have now for the method under test.

    public void DoItemsChanged(IList param)
    

    Before I had

    public void DoItemsChanged(object param)
    

    Where the param is a SelectedItemCollection (previously a RoutedEventArgs, but now I use the IvokeCommandAction on the event trigger in the view, passign the SelectedItems). The param is now more easily passed into the method for the test and the code it much more descriptive as well. So it’s all good for everyone.

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

Sidebar

Related Questions

I have a UIViewController whose view has a custom subview. This custom subview needs
I have a custom event I've made which I would like to trigger at
Currently, I have a JList listen to list selection listener. private void jList1ValueChanged(javax.swing.event.ListSelectionEvent evt)
I'm not sure if this is even possible but here goes: Currently I have
I currently have a jQuery.event listener, which once triggers will display an otherwise hidden
I have this method that I'm currently putting in each page I make, I
I have problem firing an ajax request with Primefaces <f:metadata> <f:viewParam name=token value=#{clientBean.token}/> <f:event
I want to read and write from serial using events/interrupts. Currently, I have it
I currently have an MS Access application that connects to a PostgreSQL database via
I currently have speakers set up both in my office and in my living

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.