Esempio n. 1
0
        public void Checkin2PhaseDocument()
        {
            String filename = "kt unit test1";

            if (this._verbose)
            {
                System.Console.WriteLine("Checking out document : " + filename);
            }

            kt_document_detail response = this._kt.checkout_document(this._session, this._docId, "unit test - going to checkout and then checkin", false);

            Assert.AreEqual(0, response.status_code);
            Assert.AreEqual("Administrator", response.checked_out_by);
            Assert.IsTrue(null != response.checked_out_date);

            FileUploader uploader = new FileUploader();

            uploader.upload(this._session, this._filename);
            String tempname = uploader.getFilename();

            kt_document_detail checkin = this._kt.checkin_document(this._session, this._docId, filename, "unit test - doing checkin", tempname, false);

            Assert.AreEqual(0, checkin.status_code);
            Assert.AreEqual("n/a", checkin.checked_out_by);
            Assert.AreEqual("n/a", checkin.checked_out_date);
        }
Esempio n. 2
0
        public void Add2PhaseDocument()
        {
            String filename = "kt unit test31";

            if (this._verbose)
            {
                System.Console.WriteLine("Adding document : " + filename);
            }
            FileUploader uploader = new FileUploader();

            uploader.upload(this._session, this._filename);
            String tempname = uploader.getFilename();

            kt_document_detail response1 = this._kt.add_document(this._session, this._folderId, filename, this._filename, "Default", tempname);

            Assert.AreEqual(0, response1.status_code);
            Assert.AreEqual(filename, response1.title);
            Assert.AreEqual("Default", response1.document_type);
            Assert.AreEqual(0.1, response1.version);
            Assert.AreEqual("kt_unit_test1.txt", response1.filename);

            Assert.IsFalse(response1.created_date == null);
            Assert.IsFalse(response1.created_date == "");

            Assert.AreEqual("Administrator", response1.created_by);

            //Assert.IsTrue(response1.modified_date == null);
            Assert.IsTrue("" != response1.modified_date);

            Assert.AreEqual("Administrator", response1.modified_by);

            Assert.IsTrue(response1.document_id > 0);

            Assert.AreEqual(this._folderId, response1.folder_id);


            Assert.AreEqual("n/a", response1.workflow);


            Assert.AreEqual("n/a", response1.workflow_state);


            this._docId = response1.document_id;

            kt_response response = this._kt.delete_document(this._session, this._docId, "Delete - cleaning up after add");

            Assert.AreEqual(0, response.status_code);
        }
Esempio n. 3
0
        public void Add2PhaseDocument()
        {
            String filename = "kt unit test31";

            if (this._verbose) System.Console.WriteLine("Adding document : " + filename);
            FileUploader uploader = new FileUploader();

            uploader.upload(this._session, this._filename);
            String tempname = uploader.getFilename();

            kt_document_detail response1 = this._kt.add_document(this._session, this._folderId, filename, this._filename, "Default", tempname);

            Assert.AreEqual(0, response1.status_code);
            Assert.AreEqual(filename, response1.title);
            Assert.AreEqual("Default", response1.document_type);
            Assert.AreEqual(0.1, response1.version);
            Assert.AreEqual("kt_unit_test1.txt", response1.filename);

            Assert.IsFalse(response1.created_date == null);
            Assert.IsFalse(response1.created_date == "");

            Assert.AreEqual("Administrator", response1.created_by);

            //Assert.IsTrue(response1.modified_date == null);
            Assert.IsTrue("" != response1.modified_date);

            Assert.AreEqual("Administrator", response1.modified_by);

            Assert.IsTrue(response1.document_id > 0);

            Assert.AreEqual(this._folderId, response1.folder_id);

            Assert.AreEqual("n/a",response1.workflow);

            Assert.AreEqual("n/a",response1.workflow_state);

            this._docId = response1.document_id;

            kt_response response = this._kt.delete_document(this._session, this._docId, "Delete - cleaning up after add");
            Assert.AreEqual(0, response.status_code);
        }
        public void Checkin2PhaseDocument()
        {
            String filename = "kt unit test1";

            if (this._verbose) System.Console.WriteLine("Checking out document : " + filename);

            kt_document_detail response = this._kt.checkout_document(this._session, this._docId, "unit test - going to checkout and then checkin", false);
            Assert.AreEqual(0, response.status_code);
            Assert.AreEqual("Administrator",response.checked_out_by);
            Assert.IsTrue(null != response.checked_out_date);

            FileUploader uploader = new FileUploader();

            uploader.upload(this._session, this._filename);
            String tempname = uploader.getFilename();

            kt_document_detail checkin = this._kt.checkin_document(this._session, this._docId, filename, "unit test - doing checkin", tempname, false);
            Assert.AreEqual(0, checkin.status_code);
            Assert.AreEqual("n/a",checkin.checked_out_by);
            Assert.AreEqual("n/a", checkin.checked_out_date);
        }