-
Notifications
You must be signed in to change notification settings - Fork 123
Unit tests
Nicolas Raoul edited this page Aug 21, 2019
·
17 revisions
- Create file
CmisSync/TestLibrary/test-servers.json
as explained in the header of AbstractExternalTests.cs. Please refer to this page for the meaning of each parameter. Here is the easiest way to do so:- Find or install a test CMIS server somewhere
- Create a test folder on it
- Synchronize this folder using CmisSync
- Open your CmisSync config.xml file (see Internals for its location)
- In your JSON file, set the 1st parameter to the value of config.xml's
name
- Set the 2nd parameter to config.xml's
path
- Set the 3rd parameter to config.xml's
remoteFolder
- Set the 4th parameter to config.xml's
url
- Set the 5th parameter to config.xml's
user
- Set the 6th parameter to your password (unencrypted)
- Set the 7th parameter to config.xml's
repository
- Save
- Rebuild the CmisSync solution.
- Run the tests:
- Visual Studio 2010: Download the latest 2.x release and run
nunit.exe
- Visual Studio 2012 or above: Install NUnit 2 Test Adapter, open Test > Windows > Test Explorer, rebuild the solution, the tests should appear and you can run them by pressing "Run all".
- Visual Studio 2010: Download the latest 2.x release and run
Arguably, most "unit tests" could be called "integration tests" since they perform operations on a server. But they use normal unit test syntax.
Debugging unit tests can be more convenient without the unit testing framework. This is the purpose of the TestLibraryRunner project.
Present in the Internal folder, they use the CmisSync.Lib library directly.
Present in the External, they run a CmisSync process rather than calling the library directly.
Before release, it is also always a good idea to test manually:
- On the server:
- At the root of the synchronized folder:
- Create/Rename/Modify/Delete a file
- Create/Rename/Delete a folder
- Delete a folder containing a folder and a file
- In a subfolder of the synchronized folder:
- Create/Rename/Modify/Delete a file
- Create/Rename/Delete a folder
- Delete a folder containing a folder and a file
- At the root of the synchronized folder:
- On the local client computer:
- At the root of the synchronized folder:
- Create/Rename/Modify/Delete a file
- Create/Rename/Delete a folder
- Delete a folder containing a folder and a file
- In a subfolder of the synchronized folder:
- Create/Rename/Modify/Delete a file
- Create/Rename/Delete a folder
- Delete a folder containing a folder and a file
- At the root of the synchronized folder: