Здравейте, имам проблем със следната задача от UnitTest - Exercise:
Problem 2.Extended Database
You already have a class - Database. We have modified it and added some more functionality to it. It supports adding, removing and finding People. In other words, it stores People. There are two types of finding methods - first: FindById (long id) and the second one: FindByUsername (string username). As you may guess, each person has its own unique id, and unique username. Your task is to test the provided project.
Database should have methods:
- If there are already users with this username, InvalidOperationException is thrown.
- If there are already users with this id, InvalidOperationException is thrown.
- If no user is present by this username, InvalidOperationException is thrown.
- If username parameter is null, ArgumentNullException is thrown.
- Arguments are all CaseSensitive.
- If no user is present by this id, InvalidOperationException is thrown.
- If negative ids are found, ArgumentOutOfRangeException is thrown.
Do not forget to test the constructor(s). They are methods too! Also keep in mind that all the functionality from the previous task still exists and you need to test it again!
В Джъдж ми дава 92/100 като ми гърми 4 ти тест с Грешен Отговор прилагам и код към кода ми :) https://pastebin.com/7c1ztUTY