DavidWood2001-zz / SOFT152-Assignment

This is a repo that contains all of the files for the SOFT152 assignment, also known as the AirBnB Assignment.
0 stars 0 forks source link

Add data validation to Property.cs #13

Closed DavidWood2001-zz closed 4 years ago

DavidWood2001-zz commented 4 years ago

This validation needs to include type checking, exception handling and also limitation of input, for example making sure that the 'availability' attribute can only be between 1 and 365 inclusively.

DavidWood2001-zz commented 4 years ago

Data validation has been added so that it is all internally in the Property.cs class which enables the main code to look more tidy and readable. The data validation includes all necessary constraints as well as try and catch blocks for type checking. I have also added a message box that displays whenever an error is thrown so that the user can receive feedback as to what went wrong.