xunit test asp.net MVC Core project

Опубликовано: 01 Ноябрь 2023
на канале: Cottrell Coding
1,910
26

I use xUnit to test an existing ASP.NET MVC Core project. I setup the testing permissions, add the nuget packages, and write basic Fact and Theory tests. I build two tests. One that checks that pages load as expected and return HTTP 200. The other checks for content in the HTML page.

Harry Potter fails at the end because I removed it from the table. No judgment on the book, it just caused a PK error, and deleting it was the easiest solution.