This is a basic package manager. You can install or uninstall packages to a given project. The project could contain already added packages or to have an empty collection instead. Every package has its own dependencies.
Take some time to figure out how the package manager works and to have a better understanding of the tests.
I mean it.
Go to the bottom for some hints (they are very useful) and some fun during the exam.
Check out the test requirements, to know exactly what you must test.
Think of the different testing strategies you learned during the course (mocking, extending classes, etc).
Follow the best practices for unit testing that we discussed in our lectures and workshops. (3A pattern, do not mock the SUT)
- Test the constructor if it sets the appropriate passed values
- Test for valid and invalid value Major
- Test for valid and invalid value Minor
- Test for valid and invalid value Patch
- Test for valid and invalid value VersionType
- Test the constructor if it sets the appropriate passed values
- Test if PackageRepository is set correctly for optional parameter packages
- Test if PackageRepository is set correctly for passed parameter packages
- Test if Name is set correctly
- Test if Location is set correctly
- Test the constructor if it sets the appropriate passed values
- Test if Dependencies is set correctly for optional parameter dependencies
- Test if Dependencies is set correctly for passed parameter dependencies
- Test if Name is set correctly
- Test if Version is set correctly
- Test if Url is set correctly
- Test for valid and invalid value other
- Test if the passed package is not with the same name
- Test for package passed to be higher version
- Test for package passed to be lower version
- Test for package passed to be the same version
- Test for valid and invalid value other
- Test if the passed object is IPackage
- Test for package passed to be equal to the package
- Test for package passed to be NOT equal to the package
- Test the constructor if it sets the appropriate passed values
- Test for right value set for the installer
- Test for right value set for the package
- Test for right value set for the Operation of the installer
- Test for calling the perform operation from the installer
- Test for restoring packages when the object is constructed
- should test when there are dependencies in the project
Recursion
- Test for Install command and empty dependencies list
- should call two times Download and one time Remove
- Test for Install command and at least one dependency in the dependencies list
- every dependency on the chain will multiply the calss to the Download and Remove mehtod by 2
- Test for valid and invalid value package
- Test for adding the package when the package does not exist
- Test for package already exist with the same version
- Test for calling the Update method when the package exist but with lower version
- DO NOT MOCK the System under test
- Test for package with higher version already exist
- Test for package with lower version already exist
- Test for valid and invalid value package
- Test for package not found
- Test for package found but is a dependency of other projects and cannot be removed
- Test for returning the package deleted
- Test for valid and invalid value package
- Test for package not found
- Test for successfully updated package when there is package found with lower version
- Test for found package with higher version
- Test for found package with the same version
- Test for repository with no passed collection to return as parameter empty collection
- Test for repository with passed collection as parameter to return collection with equal number of elements
Be careful with the ILogger interface. Take a look at which assembly you are refering