コード例 #1
0
ファイル: TestUploader.cs プロジェクト: killbug2004/WSProf
		public void Test_06_GetLockStatus_SetLockStatus()
		{
            Proxy.UploaderRef.Uploader uploader = new Proxy.UploaderRef.Uploader( );
			uploader.Url = Globals.UploaderUrl();
			uploader.Credentials = System.Net.CredentialCache.DefaultCredentials.GetCredential(new Uri(Globals.SharePointTestServer), "");
			string url = Globals.DocumentLibForUploadTesting()+"/Uploaded.doc";

			if (uploader.DocumentExists(url))
				uploader.Delete(url);
            Helper_EnsureDocumentIsThereForTesting(url, FILE_FOR_UPLOAD_DOC);

            Assert.IsTrue( uploader.GetLockStatus( url ) == Proxy.UploaderRef.LockStatus.Unlocked, "Document wasn't locked, so why say it is?" );
            uploader.SetLockStatus( url, Proxy.UploaderRef.LockStatus.Locked, "Testing" );
            Assert.IsTrue( uploader.GetLockStatus( url ) == Proxy.UploaderRef.LockStatus.Locked, "We just locked it." );
            uploader.SetLockStatus( url, Proxy.UploaderRef.LockStatus.Unlocked, "Testing" );
            Assert.IsTrue( uploader.GetLockStatus( url ) == Proxy.UploaderRef.LockStatus.Unlocked, "We just unlocked it." );
		}