TEST PLAN

========================================
Instructions
----------------------------------------


Some of the tests can be unit tested, some can not. Or would be extremely
difficult to do (possibly).

Setup Dropbox account locally to Mac.
Create a bash script that will perfrom updates on the files so that the conflict
logic can be tested on the iDevice.

Setup the same Dropbox account on iDevice.

Unit tests should include adding two files at a time.
Unit tests should include removing more than one file at a time.

When synch'ing w/ Dropbox, if there is no internet connection it should not
attempt to queue files. If it is a 404 it should attempt to queue the file to
upload. Otherwise, it is simply an error.

========================================
New Project: Local Filesystem
----------------------------------------

Step 1
----------------------------------------
Home
Click +
Create Local File System

Step 2: Expected
----------------------------------------
Project view displays
User puts in project name
User clicks Done

Expected
----------------------------------------
New project is created
Project is displayed to end-user
No toolbar should be displayed with SCM controls

Go to Step 1

Step 2-1: Expected
----------------------------------------
Project view displays
User puts in project name that already exists
User clicks Done

Expected
----------------------------------------
Error is displayed

Go to Step 1

Step 2-2: Expected
----------------------------------------
Project view displays
User does not put in project name
User clicks Done

Expected
----------------------------------------
Error is displayed

Go to Step 1

Step 2-3: Expected
----------------------------------------
Project view displays
User puts in a project name that begins with a period
User clicks Done

Expected
----------------------------------------
Error is displayed saying that hidden files are not supported


========================================
New Project: Dropbox
----------------------------------------

Step 1
----------------------------------------
Home
Click +
Create Dropbox

Step 2: Expected
----------------------------------------
Project view displays
User puts in project name
User clicks Done

Expected
----------------------------------------
New project is created
User is redirected back to Project page
User clicks Dropbox project
User's Dropbox data is downloaded to the device
Project is displayed to end-user
Toolbar is displayed with Dropbox options

The same error use-cases apply to a Dropbox project.

Go out of the Dropbox project
Re-enter the Dropbox project.

Expected
----------------------------------------
The Dropbox contents should NOT be synch'ed. It should only happen the first time.



========================================
Dropbox Integration: Add
----------------------------------------

New file doesn't exist on remote server (no conflict):

C: User creates a new file: test
R: plist is created and set to Add status
C: User synchronizes with Dropbox
R: plist entry is updated with local file's changes (this is done by remote server)


File exists on remote server (conflict):
C: User adds, renames, etc. a file: test_add on a different machine
C: User adds a new file: test_add
R: plist is created and set to Add status
C: User synchronizes with Dropbox

Keep:
R: File is uploaded
R: plist entry is updated with remote server info

Discard:
R: Local file is discarded and the local file downloaded
R: The original metadata is kept and used.


Test: Creating a new file within a new directory should not allow user to
add the file remotely until the parent directory has been synch'ed with the
server.

Test: When a new directory is synch'ed, all of its contents must be synch'ed.

========================================
Dropbox Integration: Modify
----------------------------------------

File not modified remotely (no conflict):

C: User updates a file
R: plist is updated with Modify status
C: User synchronizes with Dropbox
R: plist entry is updated with local file's changes (done by remote server)

File exists on remote server (conflict):
C: User updates file: test_modify on a different machine

Keep:
R: Local changes are uploaded
R: plist entry is retrieved from remote server, saved and set to Synchronized

Discard:
R: Remote changes are downloaded
R: plist entry is set to Synchronized


========================================
Dropbox Integration: Copy
----------------------------------------

Not implemented.


========================================
Dropbox Integration: Delete
----------------------------------------

C: User deletes a file
R: plist is updated with Delete status
C: User synchronizes with Dropbox
R: plist entry is removed. File in Dropbox is removed.


File already deleted remotely:

C: User deletes file on a different machine
C: User deletes a file
R: plist is updated with Delete status
C: User synchronizes with Dropbox
R: plist entry is removed immediately (as soon as check is made. No call will
   be made to Dropbox to remove the file)
   
File updated remotely (conflict):

C: User modifies file (test_delete) on a different machine
C: User deletes file: test_delete
R: plist is updated with Delete status

Keep:
R: Send command to delete file. plist entry is removed

Discard:
R: File is downloaded. plist is updated with Synchronized status


========================================
Dropbox Integration: Cancel
----------------------------------------

C: User creates new file: test
R: plist is updated with Add status
C: User updates the file to include text: "This is a test" and saves file
C: User synch's with Dropbox
R: File is added, plist is updated

C: User downloads the file, modifies, saves and then uploads the file with
   text: "This is test modify"

C: User modifies the file: test with text: "This is a test hi"
R: plist is updated with Modify status
C: User synch's with Dropbox
R: Dropbox will write a .remote file in the respective directory for file.
R: Display Alert

Cancel:
The entire operation is canceled and .remote files are removed from the system.




========================================
Dropbox Integration: Rename
----------------------------------------

C: Create new file name called: test
R: plist for file is stored at: ./dropbox/test

C: Rename file: test to: test2
R: plist for file is stored at: ./dropbox/test2
(No .rename file shall be created)

C: User synchronizes file with Dropbox
R: File's metadata plist file is stored in ./dropbox/test2 with information from Dropbox including hash, modified, etc.

C: User renames file from: test2 to: test
R: plist for file is stored at: ./dropbox/test
Renamed file is stored at: ./dropbox/test2.renamed

C: User synchronizes file with Dropbox. The file is _renamed_ remotely.
R: File's metadata plist file is stored in ./dropbox/test
Renamed file is removed at: ./dropbox/test2.renamed

C: User renames file from: test to: test2
R: plist for file is stored at ./dropbox/test2
Renamed file is stored at: ./dropbox/test.renamed

C: User creates new file: test
R: plist for file is stored at: ./dropbox/test
Renamed file is removed at: ./dropbox/test.renamed

C: User synchronizes files
R: plist for renamed file is stored at: ./dropbox/test2
plist for new file is stored at: ./dropbox/test

test2 is renames
test is uploaded

C: User deletes test2
R: plist for deleted file stays but has status set to SCMFileStatusDelete

C: User synchronizes files
R: plist for file at: ./dropbox/test2 is removed

test2 is removed from Dropbox.

C: User creates new file test2
R: plist for file is created at: ./dropbox/test2

C: User uploads file
R: plist for file is updated at: ./dropbox/test2

C: New file is created: test3
R: plist for file is created at: ./dropbox/test3

C: User deletes: test2
R: plist for file is set to SCMFileStatusDelete

C: User renames: test3 to: test2
R: plist for file at: ./dropbox/test3 is moved to: ./dropbox/test2 and over-writes delete changes. The
status is set to SCMFileStatusModify.
No test3.renamed file is created as it is a new file.

C: User synchronizes with Dropbox
R: plist for file at: ./dropbbox/test2 is updated with new information

C: User renames file: test2 to: test3
R: plist moves to: ./dropbpx/test3
Renamed file exists at: ./dropbox/test2.renamed

C: User renames file: test3 back to: test2
R: plist moves to: ./dropbox/test2
Renamed file is deleted.
No renamed file for test3.renamed is done! It is not necessary.
File status is set to SCMFileStatusModify

C: User synchronizes with Dropbox
R: plist is saved at ./dropbox/test2 with new info (if it all)

There should only be two files in the .dropbox directory:
./dropbox/test
./dropbox/test2

FOLDERS

C: User creates folder: new_folder and synch
R: plist is created for new folder and is synch'ed with server

C: User renames folder to: new_folder1
R: .renamed plist created, old plist deleted, new plist created with SCMFileStatusRename
C: User synchs
R: Folder is renamed remotely by deleting the old and adding the new folder.
   The only plist should be new_folder1
   
With the same folder: new_folder1
C: Add a new file: test into new_folder1 and synch
R: File is synched
C: User renames new_folder1 to new_folder
R: plist of file: test should have its path updated to be new_folder/test
C: User synchs
R: The folder is synch'ed by deleting the old and downloading the new folder with
   the new file: test
   
C: User renames new_folder from Mac
C: User makes a modification to iDevice file: test putting it in SCMFileStatusModify
C: User synchs from iDevice
R: Conflict is displayed. (Any file that is modified on iDevice will trigger the conflict)

Keep

R: The user is brought back to the file system screen with no changes made or
   downloaded.

Discard

R: The entire folder is removed with modified files


========================================
General Tests
----------------------------------------

Test a complete upgrade from the old version.

Local FileManager
C: Test creating a project w/ name 'Inbox'.
R: should not be able to create a FM
C: Test creating a file with '.'
R: should fail to create w/ '.'
C: Test creating a name that is empty.
R: Should not create FM w/ empty name.

Dropbox
C: Test creating a rootPath w/ '.' in front
C: Test leaving field empty so that the value becomes '/'
C: Test when the root provided is different from '/'. In fact, don't let users change this value right now.

SSH
C: Test leaving field empty so that the value becomes '~'
C: test resaving the SSH FM w/o re-entering password.
C: test all fields to ensure they contain a value -- even when spaces are put into the fields.


========================================
Version 2.0 Unit Tests
----------------------------------------

(Preparation)

Create folder /Users/eric/BufferTests
Create file /Users/eric/BufferTests/unit_test.php (same file used in Xcode tests)

(Remote Connections)

Create the connection type.
+ Must connect to /Users/eric/BufferTests
+ The default port will not be changed

Add
> Create a new file called 'test1.txt'
Expected: The server must contain a new file called 'test1.txt'. The editor should be opened immediately.

> Copy the file.
Close the editor. (Select 'No' to open file immediately)
Expected: Server must contain new file called 'test1 copy.txt'

> Open the 'test1.txt' file
Copy the file.
Open new copied file (Select 'Yes' to open file immediately)
Expected: Server must create a new file called 'newfile copy 2.txt'. The editor should open immediately

> Delete the file.
Expected: The editor should close and the file, 'test1 copy 2.txt', should be removed from the remote server.

> Open the file's information.
Rename the file 'test1 copy.txt' to 'test2.txt'.
Expected: File info should close, the file 'test1 copy.txt' should be renamed on the server to 'test2.txt'

> Attempt to create a new file called 'test2.txt'
Expected: Operation should fail as the file already exists on the server.

> Create a new folder called 'test1'
Expected: The folder should be created on the server and the folder should be immediately opened.

Go back one directory and attempt to create a folder called 'test1'
Expected: The process should fail.

> Create a new folder called 'test2'
Expected: A new folder should be created on remote server and be immediately opened.

Go back one directory.
Rename folder 'test1' to 'test2'
Expected: The operation should fail as 'test2' already exists on the server.

> Modify file 'test1.txt'
Add text 'this is a test1'
Save
Expected: The contents of the file should be saved on the server. To test this; close the editor and re-open the file. The contents of the UITextView must be 'this is a test1' 

> Create file 'test3.txt' in 'test1' folder
Navigate to 'test1' folder
Create a new file called 'test3.txt'
Expected: File 'test3.txt' should be created in the 'test1' folder and opened in the editor immediately.

Delete files used for the test in this order (so that all remote connections exist): test1.txt, test2.txt, test1/test3.txt, test1, test2
Expected: All files and folders should be removed successfully.

Test renaming the first repository 'local'. The config file MUST be renamed
with the repository.    

(Syntax)

Open 'unit_test.php'
Open the View > Syntax and change to use every langauge

(Themes)

Open 'unit_test.php'
Open the Settings > Themes and change to use every theme

(Editor Settings)

@todo

(Undo)

@todo

(Manual)

Create new connection.
Rename connection.
Ex: Should rename the directory and the respective .FileManagers config file.

Open that same connection.
For every field:
  - change the field's value
  - save
  - close
  - open
  - Ex: the field's value should have been updated.

