Commit 3e48f102ea808c9703f0fd182c0b30d6dd1637e3

Authored by Conrad Vermeulen
1 parent a0305aca

WSA-91

"error with move_document: Cannot assign object of type Dowco.KTWrapper.atlantic_kt.kt_response to an object of type Dowco.KTWrapper.atlantic_kt.kt_document_detail."
Fixed.

Committed By: Conrad Vermeulen
Reviewed By: Megan Watson

git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@7861 c91229c3-7414-0410-bfa2-8a42b809f60b
ktwebservice/nunit/document_copy.cs
... ... @@ -8,29 +8,29 @@ namespace MonoTests.KnowledgeTree
8 8  
9 9 [TestFixture]
10 10 public class DocumentCopyTest : KTTest
11   - {
12   - private int _folderId;
13   - private Document _doc1;
  11 + {
  12 + private int _folderId;
  13 + private Document _doc1;
14 14  
15 15  
16 16 [SetUp]
17 17 public void SetUp()
18   - {
19   - this._folderId = 1;
  18 + {
  19 + this._folderId = 1;
20 20  
21 21 this._doc1 = new Document(1, this._session, this._kt, this._verbose, false);
22   - this._doc1.createFile(this._folderId);
23   -
24   -
25   -
  22 + this._doc1.createFile(this._folderId);
  23 +
  24 +
  25 +
26 26 }
27 27  
28 28 [TearDown]
29 29 public void TearDown()
30 30 {
31   - this._doc1.deleteFile();
  31 + this._doc1.deleteFile();
32 32 }
33   -
  33 +
34 34 [Test]
35 35 public void FindDocumentBeforeCopy()
36 36 {
... ... @@ -47,35 +47,38 @@ namespace MonoTests.KnowledgeTree
47 47 {
48 48 System.Console.WriteLine("document not found. that is ok!");
49 49 }
50   - }
51   -
  50 + }
  51 +
52 52  
53 53 [Test]
54 54 public void CopyTest()
55 55 {
56   - kt_document_detail linkresp = this._kt.copy_document(this._session, this._doc1.docId, 1, "copy", "test123", "test123.txt");
57   - Assert.AreEqual(0, linkresp.status_code);
58   - Assert.AreEqual("test123.txt", linkresp.filename);
59   - Assert.AreEqual("test123", linkresp.title);
  56 + kt_folder_detail response2 = this._kt.create_folder(this._session, 1, "kt_unit_test_move");
  57 + Assert.AreEqual(0,response2.status_code);
  58 + int folderId = response2.id;
  59 +
  60 +
  61 + kt_document_detail linkresp = this._kt.copy_document(this._session, this._doc1.docId, folderId, "copy", "");
  62 + Assert.AreEqual(0, linkresp.status_code);
  63 + Assert.AreEqual("kt_unit_test1.txt", linkresp.filename);
  64 + Assert.AreEqual("kt unit test1", linkresp.title);
  65 +
60 66  
61   -
62 67  
63 68 }
64   -
  69 +
65 70 [Test]
66 71 public void FindDocumentAfterCopy()
67 72 {
68   - String filename = "Root Folder/test123";
  73 + String filename = "Root Folder/kt unit test1";
69 74 if (this._verbose) System.Console.WriteLine("Finding document before add: " + filename);
70 75 kt_document_detail documentDetail = this._kt.get_document_detail_by_title(this._session, 1, filename, "");
71   - Assert.AreEqual(0, documentDetail.status_code);
72   -
73   - if (this._verbose) System.Console.WriteLine("Found document - deleting");
74   - kt_response response = this._kt.delete_document(this._session, documentDetail.document_id, "Delete - cleaning up before add");
75   - Assert.AreEqual(0, response.status_code);
76   -
77   - }
78   -
  76 + Assert.AreEqual(0, documentDetail.status_code);
  77 +
  78 +
  79 +
  80 + }
  81 +
79 82  
80 83  
81 84 }
... ...