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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T15:49:58+00:00 2026-05-15T15:49:58+00:00

I have searched the forums and all over the web and have not really

  • 0

I have searched the forums and all over the web and have not really seen a straight answer for this.

I have just been introduced to moles and I read that it can mock any .NET class or function call. However, I am wondering if it is possible to use Moles to mock classes that I have created myself.

I have used MOQ before and I have read that some people use both Moles and [insert other mocking framework] in tandem but I was thinking it would be more convenient to stick with just one.

So my central question is this:

Can Moles be used to mock classes/functions that I created myself?

edit: I have seen the process done several times with DateTime and creating a .moles file with the mscorlib in the xml file. Since a user-made class does not come from a .NET library, how is this done?

  • 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-15T15:49:59+00:00Added an answer on May 15, 2026 at 3:49 pm

    Yes, as you said, Moles can mock any .NET type including types created by the end user.


    Update:

    After installing Moles:

    1. Create a new class library project to hold the unit tests for the code you want to test;
    2. On this project add a reference to the library or executable containing the code that will be under test;
    3. Build the test project in order to copy the referenced library to the local output directory;
    4. Right-click the added reference to invoke context menu where you will be presented with the option to Add Moles Assembly.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've searched for this a little but I have not gotten a particularly straight
I've have searched on this and it seems to be a catch all, unfortunately
I have searched around, and it seems that this is a limitation in MS
I'm new here, just found these forums on Google. First of all, I want
I have searched but apparently my google foo is weak. What I need is
How can I find the parameters of an undocumented Dll function? I have searched
I have a form that searches all rows in a single table (TServices) that
This is a continuation of the question Java rounded Swing JButton . I have
I have to draw underlined-multiline text with all types of text alignment. I have
I have done some searches looking for information about how to do logging with

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.