Forum Discussion
Something to suggest.
Rather than use a project variable to dictate the conditions of the switch, make that a parameter passed in to the function. Then, if you still want to use the variable, you can... or, you can just pass in the string.
What I would also do is bullet proof the string. Wrap the condition of the "switch" with something like aqString.UpperCase and then have all the cases in all upper. I'd also, suggest that you account for different possible inputs. "Google Chrome" in addition to chrome... Microsoft Edge instead of just Edge... and, you know... the default works well... but I like to control my tests a little more closely... I'd set the default to log an error and throw an exception if the user enters anything other than the desired values... if not that, at LEAST log a warning like "Unknown browser indicated; Using Microsoft Edge as default" to communicate to your user that they did something wrong.
Just my $0.02... but these are things from experience.
All of the above. Haven't gotten there yet. Thanks
Related Content
- 8 years agoSundaytwins
Recent Discussions
- 22 hours agojstaehlin