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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T11:20:15+00:00 2026-05-31T11:20:15+00:00

I am doing a TDD project using EF. I want to unit test the

  • 0

I am doing a TDD project using EF. I want to unit test the insertion operations I make. How should I do that?

What I have in mind;

  1. In the unit test, I can query the database if my insertion was successful.

  2. I can depend on other methods on my business library to check back if the insertion was successful, but I think that violates the purpose of the UNIT testing.

What are your suggestions?

Or should I use a mock framework, like Moq?

  • 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-31T11:20:16+00:00Added an answer on May 31, 2026 at 11:20 am

    This is really integration testing not unit testing, normally with TDD i test to the boundries of my system, ie to the up to but not including the component which actually calls the external system. An example of this method can be found here: http://dl.dropbox.com/u/37129059/StaticVoid.Repository.Demo.zip using my repository framework (http://blog.staticvoid.co.nz/2011/10/staticvoid-repository-pattern-nuget.html).

    Having said this its also valuable to do integration testing, especially on larger projects, whether this is via automated UI testing or some other means.

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

Sidebar

Related Questions

I have been doing TDD and was using it more as unit testing than
For TDD you have to Create a test that fail Do the simplest thing
I have not been doing TDD and Unit Tests for 7 months now and
When doing TDD , how to tell that's enough tests for this class /
I use Assert.Fail a lot when doing TDD. I'm usually working on one test
I am doing TDD on a large Java project in eclipse and am finding
I have been doing TDD for the past 3 years. We were a small
I want to try to implement the Tetris Game using TDD. From what I've
I am 'relatively new' to unit-testing and TDD. Only more recently have I completed
I want to improve the roundtrip time when doing TDD. I guess the total

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.