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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T14:34:00+00:00 2026-06-15T14:34:00+00:00

How would I use NUnit and a test database to verify my code? I

  • 0

How would I use NUnit and a test database to verify my code? I would in theory use mocks (moq) but my code is more in maintenance shape and fix it mode and I don’t have the to setup all the mocks.

Do I just create a test project, then write tests that actually connect to my test database and execute the code as I wwould in the app? Then I check the code with asserts and make sure what I’m requesting is what I’m getting back correctly?

  • 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-06-15T14:34:02+00:00Added an answer on June 15, 2026 at 2:34 pm

    How would I use NUnit and a test database to verify my code? I would
    in theory use mocks (moq) but my code is more in maintenance shape and
    fix it mode and I don’t have the to setup all the mocks.

    Using mocks is only useful if you want to test the exact implementation behavior of a class. That means you are literally asserting that one class calls a specific method on another class. For example: I want to assert that Ninja.Attack() calls Sword.Unsheath().

    Do I just create a test project, then write tests that actually
    connect to my test database and execute the code as I wwould in the
    app? Then I check the code with asserts and make sure what I’m
    requesting is what I’m getting back correctly?

    This is just a plain old unit test. If there are no obstacles to achieving this, that’s a good indicator that this is going to be your most effective method of testing. It’s practical and highly effective.

    There’s one other testing tool you didn’t mention, which is called a stub. I highly recommend you read this classic article for more info:

    http://martinfowler.com/articles/mocksArentStubs.html

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

Sidebar

Related Questions

I use NUNIT and mostly Test with ValueSource to do assertions. But i never
I have multiple NUnit tests, and I would like each test to use a
I would like to learn how to use NUnit. I learn best by reading
Is it possible to use NUnit to run CQL queries using NDepend? It would
I usually use Nunit but in my current project I am using MSTest. Now
We would like to use Selenium to test email content generated from our website.
I'm using NUnit 2.5.3, but if a more recent version of NUnit solves my
I am using .NET 4, NUnit and Rhino mocks. I want to unit test
I'm using NUnit and Rhino Mocks. I use the AAA-syntax and I do the
How would I determine the solution path from within my test code? I'm trying

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.