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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T01:24:15+00:00 2026-05-11T01:24:15+00:00

I am trying to start a new MVC project with tests and I thought

  • 0

I am trying to start a new MVC project with tests and I thought the best way to go would have 2 databases. 1 for testing against and 1 for when I run the app and use it (also test really as it’s not production yet).

For the test database I was thinking of putting create table scripts and fill data scripts within the test setup method and then deleting all this in the tear down method.

I am going to be using Linq to SQL though and I don’t think that will allow me to do this?

Will I have to just go the ADO route if I want to do it this way? Or should I just use a mock object and store data as an array or something?.

Any tips on best practices?

How did Jeff go about doing this for StackOveflow?

  • 1 1 Answer
  • 1 View
  • 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. 2026-05-11T01:24:15+00:00Added an answer on May 11, 2026 at 1:24 am

    I checked out the link from tvanfosson and RikMigrations and after playing about with them I prefer the mocking datacontext method best. I realised I don’t need to create tables and drop them all the time.

    After a little more research I found Stephen Walther’s article http://stephenwalther.com/blog/archive/2008/08/17/asp-net-mvc-tip-33-unit-test-linq-to-sql.aspx which to me seems easier and more reliable.

    So I am going with this implementation.

    Thanks for the help.

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

Sidebar

Related Questions

I am trying to start a new project (asp.net MVC) and I would like
I would like to start with integration testing. I am using an ASP.NET MVC
I have a simple WPF application which I am trying to start. I am
I am new to unit testing and I am trying to test some of
While trying to deploy a simple asp.net mvc project on an IIS 6 server,
I am currently starting a new ASP.NET MVC Project at work where we need
I'm tryingot get started with IoC, I have an MVC project in which is
I am trying to start a method from my main() as a new thread
I'm making a start on an MVC project, having gone through the MvcMusicStore tutorial.
Firstly, I'm new to MVC - and trying out ASP.NET MVC3. I 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.