Let's go invent tomorrow instead of worrying about what happened yesterday|mail@jankowskimichal.pl

Mock

Moq.EntityFrameworkCore package

From yesterday you can download package that will help you with mocking DbSet<TEntity> when you are using Moq. You can find sources and short instruction on GitHub portal or download compiled version from NuGet. New package works in the same way as Moq.EntityFramework.Helpers.

By |2017-10-15T22:51:45+02:0015 October 2017 |Categories: Projects, Testing|Tags: , , , , , |0 Comments

Mocking API with Azure Functions

The biggest advantage of Azure Functions is reducing time-to-market of our application. We can also use them to make prototyping more effective. From some time you are able to define mock of our function in Azure Portal. Function defined as mock will respond on request according to its configuration. I believe that this solution has a great potential. It can be very useful in all sort of application’s prototyping activities. You just need to define our end point and its response. And that is all. You can start using it in you prototype. So you define correct connections in your application [...]

By |2017-07-13T19:01:28+02:0013 July 2017 |Categories: Software development|Tags: , , , |2 Comments

Moq.EntityFramework.Helpers NuGet package

As you probably know I wrote two articles about mocking DbSet<TEntity> with Moq: synchronous calls – Mocking DbContext and DbSet with Moq asynchronous calls – EntityFramework – asynchronous queries unit tests I combined those solution to one library and published in on NuGet – Moq.EntityFramework.Helpers. […]

By |2017-03-07T22:07:45+01:007 March 2017 |Categories: Projects, Testing|Tags: , , , , , |2 Comments

Mocking DbContext and DbSet with Moq

I believe that during your work with unit tests with applications that are using database for data storage you will need to isolate layer that is responsible for providing data. In this example I will use Entity Framework as ORM. Below you can find main elements of solution: public class User { public int Id { get; set; } public string Login { get; set; } public string Name { get; set; } public string Surname { get; set; } public bool AccountLocked { get; set; } public virtual List<Role> Roles { get; set; } } public class UsersContext [...]

By |2021-07-13T18:58:56+02:009 February 2016 |Categories: Testing|Tags: , , , , , , , |25 Comments
Go to Top