zzz projects Entity Framework 6 EF 6
Home EF Core 5 Articles Knowledge Base Online Examples
  • Home
  • EF Core 5
  • Articles
  • Knowledge Base
  • Online Examples

Entity Framework 6 - Knowledge Base (KB)

81 results for: in tag: unit-testing

TDD and ADO.NET Entity Framework

I've been playing with ADO.NET Entity Framework lately, and I find that it suits my needs for a project I'm developing. I also find cool its non-invasive nature....After generating a data model from an existing database you are faced with the task of inte...
ado.net entity-framework integration-testing tdd unit-testing
asked by Dario Solera

Unit testing with Entity Framework

I want to test my Entities that are built using Entity Framework. My concern is that using Entity Framework means directly working with data source. So any ideas how to unit testing Entity Framework based components?
entity-framework linq unit-testing
asked by Muhammad Soliman

How to mock ObjectContext or ObjectQuery<T> in Entity Framework?

How to mock ObjectContext or ObjectQuery in Entity Framework?
.net-3.5 entity-framework mocking unit-testing
asked by saeed

Mocking Entity Framework Context

I'm using the entity framework to access my database and I want to mock the database context inside my unit tests so that I can test my middle tier classes free of their dependency on real data. I know that I'm not the first to ask about this ...(Mocking ...
entity-framework mocking unit-testing
asked by Dav Evans

How To Properly Unit-Test CRUD Operations on a Repository?

Realize this may sound like a broad question - so let me clarify. I have a Repository exposed via an interface, with two concrete implementations - a ...MockRepository... and a ...EntityFrameworkRepository.......Now, i have a Unit-Test project for which a...
c# crud entity-framework repository unit-testing
asked by RPM1984

ASP.NET MVC3 and Entity Framework Code first architecture

My previous question... made me think again about layers, repository, dependency injection and architectural stuff like this. ...My architecture now looks like this:... I am using EF code first, so I just made POCO classes, and context. That creates db a...
architecture asp.net-mvc code-first entity-framework unit-testing
asked by Damb

Fake DbContext of Entity Framework 4.1 to Test

I'm using this tutorial to Fake my DbContext and test: ...http://refactorthis.wordpress.com/2011/05/31/mock-faking-dbcontext-in-entity-framework-4-1-with-a-generic-repository/...But i have to change the FakeMainModuleContext implementation to use in my Co...
.net asp.net-mvc entity-framework tdd unit-testing
asked by Acaz Souza

Fake DbContext of Entity Framework 4.1 to Test my repositories

I'm have a Base Repository and all Entities repositories inherits from that....In my testes i create a Fake DbContext and Fake DbSet to test my repositories, but when implementing some methods in my FakeDbContext I'm not able to implement the ...IDbContex...
.net c# entity-framework repository unit-testing
asked by Acaz Souza

Unit test EF Repository pattern with Moq

I decided to start writing unit tests in our application. It uses Entity Framework with a repository pattern....Now I want to start testing logic classes which are using the repositories. I provide a simple example here....Three of my methods in the class...
entity-framework moq repository-pattern unit-testing
asked by John

How to mock EntityFramework Database created by codefirst strategy?

I have a database repository class:...public class DatabaseRepository : IRepository { private readonly Database _database; public DatabaseRepository(Database database) { _database = database; } ...
c# entity-framework mocking unit-testing
asked by Dmytro

Why DbContext doesn't implement IDbContext interface?

Why there is no ...IDbContext... interface in the Entity Framework? Wouldn't it be easier to test things if there was an existing interface with methods like SaveChanges() etc. from which you could derive your custom database context interface?...public i...
entity-framework mocking moq testing unit-testing
asked by Grief Coder

Recreate and Reseed LocalDb Before Each Unit Test

I'm attempting to write unit/integration tests for my ASP.NET Web API project and struggling to run each test in isolation. Allow me to explain....I have a *.testsettings file with deployment settings configured. Before each test run, an empty *.mdf fil...
asp.net-web-api ef-code-first entity-framework localdb unit-testing
asked by Raymond Saltrelli

Why does the Using statement give an error even though my type implements IDisposable?

In my ...DataAccess... project I have the code:...using (TandAEntities dataContext = new TandAEntities()) { // Some code } ...This gives no error and works fine....But in my Unit Test project, I have that same code, but the compiler gives an error; ty...
c# entity-framework unit-testing
asked by Cloud9999Strife

How to unit test a repository pattern that uses Entity Framework?

I'm currently trying to unit test a repository I made through Entity Framework:...What I want to happen is that test the repository without actually sending/connecting to the actual database, I want to this without using any mocking framework....Currently...
c# entity-framework repository-pattern unit-testing
asked by Randel Ramirez

How to use Moq with Entity Framework IDbSet Count() etc. methods

I'm trying to use ...Moq... to make some tests for Entity Framework Code First classes. I'm very new to Moq and mocking techniques and I wonder if it's possible to easily do a test that I will describe below. I searched through the web for some solutions,...
asp.net-mvc entity-framework moq unit-testing
asked by Episodex

Unit Testing and Entity Framework

I am very new to EF, I want to know what is the best way of creating EF with SQL Server database. After that I want to test CRUD operations. Is EF implemented in a TDD way, and I am confused by these repository patterns, mock context, fake pattern etc.. ....
asp.net-mvc-4 c# entity-framework repository-pattern unit-testing
asked by neel

Test Entity Framework Find Method

I'm trying to test the that the ...GetSystem(int id)... method in ...SystemService.cs... returns the correct value, but can't seem to figure out how to get everything to play well together. It seems that no matter what I do, ...GetSystem()... always retur...
asp.net-web-api c# entity-framework entity-framework-6 unit-testing
asked by Steve Platz

How to fake DbContext.Entry method in Entity Framework with repository pattern

Because I want to unit test my code I have implemented the repository pattern in my MVC4 application. I managed to make a Context Interface, a fake Context and use a fake implementation of a ...System.Data.Entity.DbSet... by following ...this... code....U...
asp.net-mvc-4 c# entity-framework repository-pattern unit-testing
asked by Erwin Rooijakkers

Moqing Enity Framework 6 .Include() using DbSet<>

I'd like to give the background to this question. Skip if you like. For quite a while I've paid close attention to the on going debates on stackoverflow and elsewhere regarding testing of code as it relates to EF. One camp says, test directly against a d...
entity-framework linq unit-testing
asked by GetFuzzy

Mocking Database transactions?

I have a pair of tables with a parent/child relationship - incident and incidentDetails. I have a viewmodel that contains information from both of these tables. And I have a business layer method that is passed an instance of the viewmodel that needs to ...
asp.net-mvc-4 c# entity-framework moq unit-testing
asked by Jeff Dege

Page 1 of 5
  • 1
  • 2
  • 3
  • 4
  • 5
  • »

Prime Library

Performance

  • Entity Framework Extensions
  • Entity Framework Classic
  • Bulk Operations
  • Dapper Plus

Expression Evaluator

  • C# Eval Expression
  • SQL Eval Function
More Projects...

Related

  • EF Extensions Online Benchmark
  • WIN an EF Extensions license
  • EF6 BatchSaveChanges for only $79
Save your entities 20× faster with EF Extensions
SaveChanges vs BulkSaveChanges

EF Extensions
Try for free now