-
Create a simple String calculator with a method signature:
-
The method can take up to two numbers, separated by commas, and will return their sum.
-
Allow the Add method to handle an unknown amount of numbers.
-
Allow the Add method to handle new lines between numbers (instead of commas).
-
Support different delimiters.
-
Numbers bigger than
1000
should be ignored, so adding2 + 1001 = 2
-
Delimiters can be of any length with the following format:
“//[delimiter]\n”
for example:“//[***]\n1***2***3”
should return6
-
Allow multiple delimiters like this:
“[delim1][delim2]\n” for example “[][%]\n12%3” should return 6.
-
make sure you can also handle multiple delimiters with length longer than one char.
- Add Logging Abilities to your new String Calculator (to an ILogger.Write()) interface (you will need a mock).
- Every time you call Add(), the sum result will be logged to the logger.
- When calling Add() and the logger throws an exception, the string calculator should notify an IWebservice of some
kind that logging has failed with the message from the logger’s exception (you will need a mock and a stub).
Create a Password verifications class called PasswordVerifier()
.
Add the following verifications to a master function called Verify()
- password should be larger than 8 chars
- password should not be null
- password should have one uppercase letter at least
- password should have one lowercase letter at least
- password should have one number at least
Each one of these should throw an exception with a different message of your choosing
- Add feature:
Password is OK
if at least three of the previous conditions is true - Add feature:
password is never OK
if item 1 ,4 is not true. - Assume Each verification takes 1 second to complete. How would you solve that tests can run faster?
A measuring machine measures certain parameters of a workpiece and creates a pdf report file. That pdf file will be sent to customers. Customer want to be sure that the pdf file is valid in other words it was generated by the software at the specified time and no one manipulated the file. So that pdf file has to be digitally signed.