jeudi 14 février 2019

How to Unit Test a Media Organizer in ASP MVC?

I've created a Media Organizer which uses ASP MVC & ADO.NET. This web application enables the user to upload an display files from a database. How would I unit test this?

I would like to test that all uploaded files from the DB are being shown to the user. Or that a specific file has been uploaded successfully. Simple tests like that really. I've already added a Unit Test class, it's just the code itself I would like to understand. I've familiar with using the Assert function so would like to incorporate that in some way.

Below I've included some screengrabs of my code.

The Index() function which returns the view for the list of Images.

The Repository class which sources the images for the DB

The front-end so you have an idea how the user would interact :)

I'm fairly new to programming and I very much appreciate your help! Let me know if you need any further info.

Aucun commentaire:

Enregistrer un commentaire