effort

Using Effort (EF Testing Tool) with Computed Column

一个人想着一个人 提交于 2020-01-04 04:15:11
问题 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 and it works very easily. However I've hit a problem that I have been trying - but unable to solve. One of the tables that I need filled up with dummy data - as a test prerequisite - contains a computed column (nvarchar, not null). For the scope of

Effort unit testing Entity framework 6.1.3 DB-first

旧街凉风 提交于 2019-12-21 07:10:44
问题 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 have created a partial class to expose an additional constructor used by the unit tests with effort like this: public partial class Entities { public Entities(DbConnection connection) : base(connection, true) { } } The simple unit-test looks like

How would I configure Effort Testing Tool to mock Entity Framework's DbContext withOut the actual SQL Server Database up and running?

半腔热情 提交于 2019-12-19 10:26:42
问题 Our team's application development involves using Effort Testing Tool to mock our Entity Framework's DbContext. However, it seems that Effort Testing Tool needs to be see the actual SQL Server Database that the application uses in order to mock our Entity Framework's DbContext which seems to going against proper Unit Testing principles. The reason being that in order to unit test our application code by mocking anything related to Database connectivity ( for example Entity Framework's

Effort (EF Unit Testing) giving errors

懵懂的女人 提交于 2019-12-11 06:33:01
问题 I am trying to do unit testing on some classes that reply on an Entity Framework DB Context. For help, I managed to find a library called Effort, which seems to be a little old, and not very well documented, but it seems to work, and seems to be quite popular. I am trying to use a CSV data loader. When doing a ToArray() I receive an exceptions saying Sequence contains no matching element . Any ideas on what I might be doing incorrectly? Or if not a different library I might want to give a

Effort- FirstOrDefault returns null when Faking Database

自古美人都是妖i 提交于 2019-12-10 20:03:17
问题 I'm trying to create some unit tests for my project, after much digging around I found Effort, the idea is great, it mocks the database instead of the dealing with faking the DBContext which by the way is really hard to get it right when using a complex schema. However I'm trying to get the Email of a user after I specifically added it to the in-memory database create by Effort, here is the code MyContext contextx = new MyContext(Effort.DbConnectionFactory.CreateTransient()); var client = new

Effort Unit test: Argument 'xmlReader' is not valid

狂风中的少年 提交于 2019-12-10 10:26:26
问题 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 then i get the following error: Argument 'xmlReader' is not valid. A minimum of one .ssdl artifact must be supplied. It appears to be that having the than one method using effort across more than one class causes the error. I rather not have all my

Effort unit testing Entity framework 6.1.3 DB-first

不想你离开。 提交于 2019-12-03 23:54:54
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 have created a partial class to expose an additional constructor used by the unit tests with effort like this: public partial class Entities { public Entities(DbConnection connection) : base(connection, true) { } } The simple unit-test looks like this: private Entities CreateContext() { //var connectionString = ConfigurationManager

How would I configure Effort Testing Tool to mock Entity Framework's DbContext withOut the actual SQL Server Database up and running?

我怕爱的太早我们不能终老 提交于 2019-12-01 11:24:46
Our team's application development involves using Effort Testing Tool to mock our Entity Framework's DbContext. However, it seems that Effort Testing Tool needs to be see the actual SQL Server Database that the application uses in order to mock our Entity Framework's DbContext which seems to going against proper Unit Testing principles. The reason being that in order to unit test our application code by mocking anything related to Database connectivity ( for example Entity Framework's DbContext), we should Never need a Database to be up and running. How would I configure Effort Testing Tool to