public void MSLISTSWS_S05_TC04_CheckInFile_Succeed()
        {
            // create a list by using document library template
            string listTitle            = TestSuiteHelper.GetUniqueListName();
            int    docLibraryTemplateId = (int)TemplateType.Document_Library;

            TestSuiteHelper.CreateList(listTitle, docLibraryTemplateId);

            // Upload the file to the document library
            string absoluteFileUrl = this.sutControlAdapter.UploadFile(listTitle);

            Site.Assert.IsTrue(
                !string.IsNullOrEmpty(absoluteFileUrl),
                "Upload file to the list {0} should be successful, the file path is [{1}]",
                listTitle,
                absoluteFileUrl);

            #region Check out the added file.
            bool checkOutSucceeded = false;
            checkOutSucceeded = this.listwsInstance.CheckOutFile(absoluteFileUrl, bool.TrueString, string.Empty);
            Site.Assert.IsTrue(checkOutSucceeded, "CheckOutFile must succeed!");
            #endregion

            #region Check in the file which has been checked out.
            bool checkInSucceeded = false;

            // generate a random string.
            string checkInComments = TestSuiteHelper.GenerateRandomString(5);
            checkInSucceeded = this.listwsInstance.CheckInFile(absoluteFileUrl, checkInComments, CheckInTypeValue.MajorCheckIn);

            #endregion

            #region Capture R16381, R398 and R1660 if the CheckInFile succeeds and returns true value.

            // Verify requirement R16381.
            // If there are no other errors, it means implementation does support this CheckInFile method. R16381 can be captured.
            if (Common.IsRequirementEnabled(16381, this.Site))
            {
                Site.CaptureRequirementIfIsTrue(
                    checkInSucceeded,
                    16381,
                    @"Implementation does support this method[CheckInFile]. (Windows SharePoint Services 3.0 and above follow this behavior.)");
            }

            // If CheckInFile operation return true, capture R398, 1660
            Site.CaptureRequirementIfIsTrue(
                checkInSucceeded,
                398,
                @"[In CheckInFile operation] If there are no other errors, the document located at pageUrl MUST be checked-in by using comments and CheckinType specified in the CheckInFileSoapIn request message.");

            Site.CaptureRequirementIfIsTrue(
                checkInSucceeded,
                1660,
                @"[CheckInFileResponse][CheckInFileResult]The value is True if the operation is successful;");
            #endregion
        }
        public void MSLISTSWS_S05_TC08_UndoCheckOut_WithNoDocument()
        {
            // create a normal document Library and upload a file to SUT
            string listTitle            = TestSuiteHelper.GetUniqueListName();
            int    docLibraryTemplateId = (int)TemplateType.Document_Library;

            TestSuiteHelper.CreateList(listTitle, docLibraryTemplateId);

            // Upload the file to the document library
            string absoluteFileUrl = this.sutControlAdapter.UploadFile(listTitle);

            Site.Assert.IsTrue(
                !string.IsNullOrEmpty(absoluteFileUrl),
                "Upload file to the list {0} should be successful, the file path is [{1}]",
                listTitle,
                absoluteFileUrl);

            #region Invoke UndoCheckOut operation with pageUrl not referring to a document library, and catch the exception.

            string errorCode          = string.Empty;
            bool   isSoapFaultExisted = false;
            try
            {
                this.listwsInstance.UndoCheckOut(absoluteFileUrl + TestSuiteHelper.GenerateRandomString(2));
            }
            catch (SoapException soapEx)
            {
                isSoapFaultExisted = true;
                errorCode          = TestSuiteHelper.GetErrorCode(soapEx);
            }
            #endregion

            #region Capture R786 R1964
            // If Soap Fault Existed, Capture R786
            Site.CaptureRequirementIfIsTrue(
                isSoapFaultExisted,
                786,
                "[In UndoCheckOut operation] If the pageUrl does not refer to a document, the protocol server MUST return a SOAP fault. ");

            // If there is no any error code in soap fault, capture R1964
            Site.CaptureRequirementIfIsTrue(
                string.IsNullOrEmpty(errorCode),
                1964,
                "[In UndoCheckOut operation] [If the pageUrl does not refer to a document, the protocol server MUST return a SOAP fault.] There is no error code for this fault.");
            #endregion
        }