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

moq

Moq.EntityFrameworkCore version 5.0.0.1

I just managed to publish a new version of package Moq.EntityFrameworkCore. This package allows you to write unit tests in the project that are using EntityFrameworkCore package in a more effective way. With version 5.0.0.1  following changes have been introduced: support for EntityFrameworkCore v5.0 extension of mock strategy to support sequential mocks More information about the project is available on GitHub.

By |2020-11-30T09:27:11+01:0030 November 2020 |Categories: Projects, Testing|Tags: , , |0 Comments

Moq.EntityFrameworkCore version 3.1.2.6

I just managed to publish a new version of package Moq.EntityFrameworkCore. This package allows you to write unit tests in the project that are using EntityFrameworkCore package in a more effective way. With version 3.1.2.6  following changes have been introduced: extension of package support to objects that do not have DbContext as a based type More information about the project is available on GitHub.

By |2020-06-30T19:14:22+02:0030 June 2020 |Categories: Projects, Testing|Tags: , , , |0 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

Moq + xUnit + AutoFixture – cheat sheet

Please find new cheat sheet that I created for following tools related to unit test: Moq, AutoFixture and xUnit. Moq - AutoFixture - xUnit - Cheat sheet page 1 Moq - AutoFixture - xUnit - Cheat sheet page 2 Provided cheat sheet is based on two articles: Moq Quickstart and AutoFixture Cheat Sheet. And the most important thing – link to .

By |2017-09-21T20:28:46+02:005 January 2016 |Categories: Testing|Tags: , , , |1 Comment
Go to Top