nbarbettini / little-aspnetcore-book

The Little ASP.NET Core Book, a friendly introduction to web programming and ASP.NET Core 2.0
http://littleasp.net/book
Creative Commons Attribution 4.0 International
702 stars 190 forks source link

Update testing chapters - how to test with Identity #72

Open klinge opened 5 years ago

klinge commented 5 years ago

I really enjoyed this book for learning some basics of aspnet core. Thanks!

Since I am a big fan of automated testing I wanted to see if I could build some extra unit tests for controllers and expand the integration tests with tests for logged in users. After reading several articles on this on the net I find that unit/integration testing with AspNetCore.Identity (mocking ApplicationUser in unit tests and somehow simulating a logged in user for integration tests) is really challenging.

If and when there is an update to the next major dotnet core version adding info on how to do this to the testing chapters would be very helpful!