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

AutoFixture

Speeding up AutoFixture

I already mentioned about AutoFixture in one of the posts – Lightning talk – Autofixture. Main goal of this library is to help us with reduction of Arrange part of unit tests. With this library we can focus on the main scenario of unit test instead of focusing on building objects that are needed for test. Moreover AutoFixture will protect us against modification of classes that are being used in our unit tests. But it is not perfect. Sometimes duration of unit tests can increase dramatically. Especially when you are creating objects used by EntityFramework. […]

By |2017-01-31T21:34:37+01:001 February 2017 |Categories: Testing|Tags: , , |1 Comment

Lightning talk – Autofixture

I would like to encourage you to download and go through presentation from lighting talk about AutoFixture library. Main purpose of this library is to minimize the ‘Arrange’ phase of unit tests in order to maximize maintainability. Presentation is available on GitHub – AutoFixture - Lightning talk. You will find there description of main features of this library. Moreover, presentation contains short comparison AutoFixture with other available solutions. Of course on GitHub you will find code used in presentation.

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