C# OOP / UnitTesting / Exercise / 04. Fighting Arena

Здравейте! На задача 4. Fighting Arena в Judge - ми дава 92/100. Някой може ли да помогне?

Прикачвам условие: 

Problem 1.Fighting Arena

You are provided with a project named "FightingArena" containing two classes - "Warrior" and "Arena".  Your task here is simple - you need to write tests on the project covering the whole functionality. But before start writing tests, you need to get to know the project's structure and business logic. Each Arena has a collection of Warriors enrolled for the fights. In the ArenaWarriors should be able to Enroll in the fights and fight each other. Each Warrior has a unique namedamage, and HPWarriors can attack other Warriors. Of course, there is validations:

  • Name cannot be null, empty, or whitespace
  • Damage cannot be zero or negative
  • HP cannot be negative
  • Warrior cannot attack if his HP is below 30
  • Warrior cannot attack Warriors whose HP are below 30
  • Warrior cannot attack stronger enemies

On the Arena there should be performed some validations too:

  • Already enrolled Warriors should not be able to enroll again
  • There cannot be a fight if one of the Warriors is not enrolled for the fights

In the skeleton, you are provided Test Project named "FightingArena.Tests". There you should place all the unit tests you write. The Test Project has two classes inside:

  • "WarriorTests" - here you should place all code testing the "Warrior" and its functionality
  • "ArenaTests" - here you should place all code testing the "Arena" and its functionality

Your job now is to write unit tests on the provided project and its functionality. You should test exactly every part of the code inside the "Warrior" and "Arena" classes:

  • You should test all the constructors
  • You should test all properties (getters and setters)
  • You should test all the methods and validations inside the class

Before you submit your solution to Judge, you should remove all the references and namespaces referencing the other project. You should upload only the "FightingArena.Tests" project holding the two classes with your tests. Remove the "bin" and "obj" folders before submission.

Constraints

  • Everything in the provided skeleton is working perfectly fine
  • You mustn't change anything in the project structure
  • You shouldn't test the auto-properties
  • Any part of validation should be tested
  • There is no limit on the tests you will write but keep your attention on the main functionality

https://judge.softuni.org/Contests/Compete/Index/1762#3

 

Моето решение: https://pastebin.com/vTTuBwWK