Unit tests - aegif/CmisSync GitHub Wiki

How to run the CmisSync tests

  1. 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
  2. Rebuild the CmisSync solution.
  3. 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".

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.

Internal tests

Present in the Internal folder, they use the CmisSync.Lib library directly.

External tests

Present in the External, they run a CmisSync process rather than calling the library directly.

Manual tests

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
  • 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