DavidAJohn / BookwormsLendingLibrary

Blazor Server client UI with a .NET Web API backend for an imaginary online library.
https://bookwormslibrary.azurewebsites.net
6 stars 4 forks source link

Add unit tests to the UI #5

Open DavidAJohn opened 3 years ago

DavidAJohn commented 3 years ago

As well as needing tests in the API, there is a Blazor testing library called bUnit that could be used to add unit tests to the UI project.

You can find bUnit here.

DavidAJohn commented 3 years ago

I've been experimenting with bUnit in a separate branch (which I haven't pushed to the remote repo yet).

Carl Franklin did a really nice demo of it on BlazorTrain: https://www.youtube.com/watch?v=8So3TXW2QKU

Interestingly, Egil Hansen (the creator of bUnit) mentions in the comments on Carl's video that there is an "as yet undocumented" way to use bUnit which he has used in his Blazing Pizza project

DavidAJohn commented 2 years ago

The UI test project (using bUnit) has now been merged into the main branch.

I'm continuing to add additional unit tests to the project.