TheCSharpAcademy / CONSOLE.PointOfSale

6 stars 15 forks source link

Test/IsValidAnswer brun32700 #54

Closed brun32700 closed 1 year ago

brun32700 commented 1 year ago

Resolves #49

Summary: -> Wrote tests for IsValidAnswer() method for when it should return True and False results. Let me know if I missed some edge cases.

Observation: -> Currently, the Validation.IsValidAnswer() method has no space (trim) or case sensitivity checks, so this means that the following values: 'NO', 'n ', 'YeS' and ' y ' are false. Is this the intended behaviour of this method?

kimfom01 commented 1 year ago

@brun32700 I think you have a point. We might need to extend the method to make it more flexible i.e. allow leading and/or trailing whitespaces and case insensitivity but lets hear what @TheCSharpAcademy has to say about it

TheCSharpAcademy commented 1 year ago

@kimfom01 @brun32700 Good stuff, you're both right. However I won't raise an issue because I intend to add a library that let's us use arrows to choose options.