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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T22:26:00+00:00 2026-05-16T22:26:00+00:00

Visual Studio 2010 generated a bunch of unit tests for me which seems to

  • 0

Visual Studio 2010 generated a bunch of unit tests for me which seems to be handy, but I question whether they are actual unit tests. For example, it generated a test it called SaveTest which executes the following code:

User user = new User();  //I have to create a user
user.Save(); //This saves the user to the database.
//Assertions here....

The problem I have above is that from what I have read, unit tests are supposed to test things in Isolation, so by testing Saving to the database, this is not a unit test or am I wrong and does MsTest get it wrong? As a side note, User is generated from by dbml and Save calles SubmitChanges on my DataContext.

  • 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-16T22:26:00+00:00Added an answer on May 16, 2026 at 10:26 pm

    The auto-generated tests are only unit tests if you’ve already done the necessary work to isolate dependencies so that the calls with side effects can be routed to the appropriate mocked or stubbed dependencies for sensing the desired effects. The tools won’t do the work of architecting your code to support unit testing; all they can do is create calls to the various public access points. You’ll also still have to do the work of arranging your dependency states for each test and asserting the conditions you wish to check.

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

Sidebar

Related Questions

I know it's still in CTP, but is Visual Studio 2010 stable enough for
I have created a Entity Framework 4 model with Visual Studio 2010 and generated
I am using Visual Studio 2010 and would like to exclude the generated service
I am new to programming but attempting to learn. Im running visual studio 2010
I'm using Visual Studio 2010 Ultimate, and it seems that I cannot suppress warnings
With the recent announcement of .NET 4.0 and Visual Studio 2010, it is becoming
With the recent news about F# being included with Visual Studio 2010, I got
Visual studio is pretty good but doesn't create stored procedures automatically. Iron Speed designer
I am using Visual Studio 2010 Beta 2, I want to package and deploy
I am running Visual Studio 2010. I have a XSD schema and want to

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.