Не мога да разбера условието на задачата и по точно, как точно трябва да са построени тези категории. Направо слагам условието тук, тъй като не е много дълго:
Problem 5. **Integration Tests When you create tests for a program, you should decouple a method which you test, so you could test a single problem. If a method is coupled to another one or it is doing more job that it is supposed to do, you could not clearly tell, which part is buggy. So when you create test, to determine which exactly is the problem, you separate each operation of the method and test each of them, to be sure, everything is working correctly. But there is another instance of the Unit Testing - Integration testing. When you do integration testing, you are testing the relationships of the models and the functions. You are a web developer and your boss assigns you a task to implement the backend logic of the following problem. You have a site with the following two models: Category has a: • Name. • Set of Users. • (optional) Set of Categories (children) User has a: • Name. • Set of Categories Functions to implement: • Add Categories • Remove Category / Categories • Assign a child Category to a single Category. • Assign a User to specific Category. Task Create tests for all the classes. Test, do they work correctly together. Keep in mind, you should test the border cases which are very interesting in this domain. Hint In case you have a child Category and you remove its parent Category, if it has any Users, they must be reassigned to the child Category. If you try to move a child Category from its parent to another, don’t forget to remove the relationship from the first one. (e.g. When you move a Category from one parent to another, don’t copy the child to the both parents. Instead, create new child with all characteristics of the previous one and assign it to the new parent)
Не успях да намеря отворена тема във форум, и се надявам някой да го разясни, какво точно трябва да създадем като логика.