Questions tagged [effort]

Effort is a tool that enables a convenient way to create automated tests for Entity Framework based applications.

It is basically an ADO.NET provider that executes all the data operations on a lightweight in-process main memory database instead of a traditional external database. It provides some intuitive helper methods too that make really easy to use this provider with existing ObjectContext or DbContext classes. A simple addition to existing code might be enough to create data driven tests that can run without the presence of the external database

https://github.com/tamasflamich/effort

58 questions
17
votes
1 answer

Effort unit testing Entity framework 6.1.3 DB-first

I am experiencing problems when using Effort framework (version 1.1.4) to unit test my DB-layer. I have a DB-layer using Entity framework 6.1.3 and the model is created using database-first approach so there is an *.edmx file describing the model. I…
gurkan
  • 899
  • 1
  • 10
  • 21
13
votes
3 answers

Unable to use existing database in unit tests with Effort framework

I am trying to write test using a database, hosted in Azure SQL, with Effort framework on Entity Framework 6. When executing the following code, an exception is thrown: [ClassInitialize] public static void ClassInitialize(TestContext context) { …
11
votes
1 answer

Difference between DbTransaction and DbContextTransaction?

When EntityFramework query was wrapped in DbContextTransaction created with dbContext.Database.BeginTransaction() method I've got the following error: at NMemory.Transactions.Transaction.EnsureTransaction(Transaction& transaction, IDatabase…
msmolcic
  • 6,407
  • 8
  • 32
  • 56
9
votes
2 answers

Using Effort with EF6 in a DB First approach

I'm using the Model First approach with EF6 and I'm trying to use Entity Framework Effort to develop in-memory tests. Here is what I do in my test: var inMemoryConnection = Effort.DbConnectionFactory.CreateTransient("name=MyEntities"); var…
Boubou
  • 632
  • 5
  • 18
9
votes
1 answer

Entity Framework Core - In Memory Provider Required Field

In previous versions of Entity Framework I have been using Effort (https://effort.codeplex.com/) for unit tests. I decided to give the new in memory provider for EF Core and quickly found out that it does not honor the IsRequired() and other entity…
Matt Sanders
  • 953
  • 1
  • 13
  • 23
8
votes
1 answer

How do I get Effort to work with EntityFramework?

OVERVIEW Using Fitnesse with EF6, can't get Effort to start up. I've tried every trick in all the posts I can find. All the posts say to either call 'RegisterProvider', or add a config section. Neither is working. So far: I have "Effort.Provider"…
BWhite
  • 713
  • 1
  • 7
  • 24
7
votes
3 answers

Unenforce foreign key references in Effort

I am using Effort in Visual Studio and C# to recreate and unit test a database. I am writing a class for a single table and so I am only populating the database with objects from that table. My problem is that the Effort database wants the object's…
A_Arnold
  • 3,195
  • 25
  • 39
5
votes
1 answer

NUnit : Effort.Exceptions.EffortException : The Effort library failed to register its provider automatically, so manual registration is required

I am working on Web API and while unit testing using NUnit i faced this error which said: Tests.DemoTest.SessionLogOnBreakdownTest: SetUp : Effort.Exceptions.EffortException : The Effort library failed to register its provider automatically, so…
Nameless
  • 1,026
  • 15
  • 28
5
votes
2 answers

Effort (EF6) exception when accessing DbSet (The given key was not present in the dictionary)

This is proving to be a little hard to trace down, but when using Effort for testing Entity Framework 6, I seem to get a KeyNotFoundException ("The given key was not present in the dictionary") error when trying to access one of the DBSet…
Stefan Zvonar
  • 3,959
  • 3
  • 24
  • 30
5
votes
1 answer

Effort Unit test: Argument 'xmlReader' is not valid

I'm currently trying to unit test a context class of the Entity Framework with the "Effort" framework (http://effort.codeplex.com/wikipage?title=Tutorials&referringTitle=Home) If my unit test project has two classes that contain methods use effort…
rawajames
  • 105
  • 1
  • 7
4
votes
2 answers

Making tests faster by using only partial database in EntityFramework Effort

Use case: We have a quite large database (about 200 tables) that is used in a large (legacy) system. It's implemented as a database-first approach, with one edmx file defining the entire database. We are using XUnit and Effort for automatic testing.…
Ropez
  • 3,485
  • 3
  • 28
  • 30
4
votes
1 answer

Testing eager-loading scenarios with Effort.EF6

We're using Effort.EF6 to build a test suite for an ASP.NET Web API 2 service working against an in-memory database, and for the most part it's a wonderful experience. However, for reasons unrelated to this question, we have had to turn off lazy…
Tomas Aschan
  • 58,548
  • 56
  • 243
  • 402
4
votes
2 answers

Using Effort (EF Testing Tool) with Computed Column

I have a number of integration tests which access the DB directly - create test prerequisite objects - performs the tests and then cleans up afterwards - however I wonted to try out the same approach in-memory. I have just used Effort in my project…
3
votes
2 answers

UnintentionalCodeFirstException | Entity Framework Unit Testing with Effort.Ef6 using Database First

The situation I want to enable unit testing of my DbContext based on entity framework 6. I have created my DbContext and my models with the database first approach and now have an .edmx designer file. The problem My automatically created DbContext…
ˈvɔlə
  • 9,204
  • 10
  • 63
  • 89
3
votes
1 answer

Effort.Exceptions.EffortException : Database has not been initialized - after non commited update?

Why does this exception occur? Is this a bug? I'm using Effort, the EF testing library to create an in memory instance of my database and run into this interesting scenario: Open DbContext1 Add item to Table (do not save) Close DbContext1 Open…
Philip Pittle
  • 11,821
  • 8
  • 59
  • 123
1
2 3 4