Session
Integration Testing ASP.NET Core with WebApplicationFactory
If you want your development life to be easy, you've got to have automated tests and unit tests are the best option. Or are they? In ASP.NET Core, there are some things that unit tests just can't easily handle and integration tests come in. Or maybe you never wrote unit tests in the first place and now you need some automated tests. ASP.NET Core has this awesome utility class named WebApplicationFactory and it makes writing integration tests against your application code a whole lot easier.
In this session, we'll start by talking about the differences between unit tests vs. integration tests and what each type of test is good for. Then we'll do a quick tour of WebApplicationFactory and HttpClient. After that, we'll dive in and start writing integration tests to do handy things like making sure that your dependency injection configuration is right, test your MVC and WebAPI routes, test your WebAPI controllers, and test your MVC controllers. Plus, Ben will show you some tricks that'll make integration testing easier such as directly accessing EF Core from your tests and (gasp!) turning off ASP.NET security from your tests.
Please note that Sessionize is not responsible for the accuracy or validity of the data provided by speakers. If you suspect this profile to be fake or spam, please let us know.
Jump to top