Created
December 20, 2011 03:37
-
-
Save tallseth/1500120 to your computer and use it in GitHub Desktop.
Entity framework unit test problem
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//works | |
public void Update(Job job) | |
{ | |
//How do you unit test this line without communicating with a DB? | |
context_.Entry(job).State = EntityState.Modified; | |
context_.SaveChanges(); | |
} | |
//doesn't work | |
public void Update(Job job) | |
{ | |
//Can I make sure it doesn't get turned into this? | |
context_.Entry(job).State = EntityState.Deleted; | |
context_.SaveChanges(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment