GetCurrentVersion() 공개 정적인 메소드

Get the current version.
public static GetCurrentVersion ( VersionData versions ) : string
versions VersionData All the versions of file.
리턴 string
예제 #1
0
        /// <summary>
        /// Verify the VersionData complex type related requirements
        /// </summary>
        /// <param name="versionDataArray">An array of VersionData object.</param>
        /// <param name="isSchemaVerified">A Boolean value indicates whether the schema has been verified.</param>
        private void VerifyVersionDataComplexType(VersionData[] versionDataArray, bool isSchemaVerified)
        {
            #region Verify MS-VERSS_R56
            // Add the debug information
            Site.Log.Add(LogEntryKind.Debug, "Verify MS-VERSS_R56");

            // Verify MS-VERSS requirement: MS-VERSS_R56
            Site.CaptureRequirementIfIsTrue(
                isSchemaVerified,
                56,
                @"[In VersionData] The VersionData complex type specifies the details about a single version of a file.
<s:complexType name=""VersionData"">
  <s:attribute name=""version"" type=""s:string"" use=""required"" />
  <s:attribute name=""url"" type=""s:string"" use=""required"" />
  <s:attribute name=""created"" type=""s:string"" use=""required"" />
  <s:attribute name=""createdRaw"" type=""s:string"" use=""required"" />  
  <s:attribute name=""createdBy"" type=""s:string"" use=""required"" />
  <s:attribute name=""createdByName"" type=""s:string"" use=""optional"" />
  <s:attribute name=""size"" type=""s:unsignedLong"" use=""required"" />
  <s:attribute name=""comments"" type=""s:string"" use=""required"" />
</s:complexType>");
            #endregion

            #region Verify MS-VERSS_R58
            // According to MS-OFCGLOS,the current version is the latest version of a document.
            // Then current version is the most recent version of the file.
            // If the current version is preceded with an at sign (@),then R58 will be verified.
            string currentVersion = AdapterHelper.GetCurrentVersion(versionDataArray);

            // Add the debug information
            Site.Log.Add(LogEntryKind.Debug, "Verify MS-VERSS_R58, the value of current version is {0}", currentVersion);

            bool isR58Verified = currentVersion.StartsWith("@", System.StringComparison.CurrentCulture);

            // Verify MS-VERSS requirement: MS-VERSS_R58
            Site.CaptureRequirementIfIsTrue(
                isR58Verified,
                58,
                @"[In VersionData] version: The most recent version of the file MUST be preceded with an at sign (@).");
            #endregion

            #region Verify MS-VERSS_R59
            foreach (VersionData versionData in versionDataArray)
            {
                if (versionData.version != currentVersion)
                {
                    float versionNumber;
                    bool  isR59Verified = float.TryParse(versionData.version, out versionNumber);

                    // Add the debug information
                    Site.Log.Add(
                        LogEntryKind.Debug,
                        "Verify MS-VERSS_R59, the value of version is {0}",
                        versionData.version);

                    // Verify MS-VERSS requirement: MS-VERSS_R59
                    Site.CaptureRequirementIfIsTrue(
                        isR59Verified,
                        59,
                        @"[In VersionData] version: All the other versions MUST exist without any prefix. ");
                }
            }
            #endregion

            #region Verify MS-VERSS_R60101
            foreach (VersionData versionData in versionDataArray)
            {
                System.Text.RegularExpressions.Regex regex = new System.Text.RegularExpressions.Regex(@"^@?\d+\.\d+$");

                bool isR60101Verified = regex.IsMatch(versionData.version);

                if (Common.IsRequirementEnabled(60101, this.Site))
                {
                    // Add the debug information
                    Site.Log.Add(
                        LogEntryKind.Debug,
                        "Verify MS-VERSS_R60101, the value of attribute version in VersionData is {0}",
                        versionData.version);

                    // Verify MS-VERSS requirement: MS-VERSS_R60101
                    Site.CaptureRequirementIfIsTrue(
                        isR60101Verified,
                        60101,
                        @"[In Appendix B: Product Behavior] Implementation does contain the version of the file, including the major version and minor version numbers connected by period, for example, ""1.0"". (Windows SharePoint Services 3.0 and above follow this behavior.)");
                }
            }
            #endregion

            #region Verify MS-VERSS_R61
            foreach (VersionData versionData in versionDataArray)
            {
                System.Uri versionDataUrl = new System.Uri(versionData.url);
                bool       isR61Verified  = AdapterHelper.ValidateAbsoluteUrlFormat(versionDataUrl);

                // Add the debug information
                Site.Log.Add(
                    LogEntryKind.Debug,
                    "Verify MS-VERSS_R61, the value of attribute URL in VersionData is {0}",
                    versionData.url);

                // Verify MS-VERSS requirement: MS-VERSS_R61
                Site.CaptureRequirementIfIsTrue(
                    isR61Verified,
                    61,
                    @"[In VersionData] url: The complete URL of the version of the file.");
            }
            #endregion

            #region Verify MS-VERSS_R164
            foreach (VersionData versionData in versionDataArray)
            {
                bool isR16401Enabled = Common.IsRequirementEnabled(16401, this.Site);
                bool isR16402Enabled = Common.IsRequirementEnabled(16402, this.Site);

                if (isR16401Enabled)
                {
                    // Add the debug information
                    Site.Log.Add(LogEntryKind.Debug, "Verify MS-VERSS_R16401");

                    // Verify MS-VERSS requirement: MS-VERSS_R16401
                    Site.CaptureRequirementIfIsNotNull(
                        versionData.createdRaw,
                        16401,
                        @"[In Appendix B: Product Behavior] Implementation does return this attribute. [In VersionData] createdRaw: The creation date and time for the version of the file in Datetime format, as specified in [ISO-8601]. (Microsoft SharePoint Foundation 2010 and above follow this behavior.)");
                }

                if (isR16402Enabled)
                {
                    // Add the debug information
                    Site.Log.Add(LogEntryKind.Debug, "Verify MS-VERSS_R16402");

                    // Verify MS-VERSS requirement: MS-VERSS_R16402
                    Site.CaptureRequirementIfIsNull(
                        versionData.createdRaw,
                        16402,
                        @"[In Appendix B: Product Behavior] Implementation does not return this attribute. [In VersionData] createdRaw: The creation date and time for the version of the file in Datetime format, as specified in [ISO-8601]. (<1> Section 2.2.4.3: Windows SharePoint Services 3.0 does not return this attribute.)");
                }
            }
            #endregion

            #region Verify MS-VERSS_R65
            foreach (VersionData versionData in versionDataArray)
            {
                // Add the debug information
                Site.Log.Add(
                    LogEntryKind.Debug,
                    "Verify MS-VERSS_R65, the value of attribute comments in VersionData is {0}",
                    versionData.comments);

                // Verify MS-VERSS requirement: MS-VERSS_R65
                Site.CaptureRequirementIfIsNotNull(
                    versionData.comments,
                    65,
                    @"[In VersionData] comments: The comment entered when the version of the file was replaced on the protocol server during check in.");
            }
            #endregion
        }
        /// <summary>
        /// A common method used to verify that the client uses the RestoreVersion operation to successfully restore
        /// the file specified by a URL to a specific version when check out is enforced.
        /// </summary>
        /// <param name="url">The URL of a file.</param>
        private void RestoreVersionVerification(string url)
        {
            // Enable the versioning of the list.
            bool setVersioning = this.sutControlAdapterInstance.SetVersioning(this.documentLibrary, true, true);

            Site.Assert.IsTrue(
                setVersioning,
                "SetVersioning operation returns {0}, TRUE means the operation was executed successfully," +
                " FALSE means the operation failed",
                setVersioning);

            // Upload the file into specific list.
            bool isAddFileSuccessful = this.sutControlAdapterInstance.AddFile(this.documentLibrary, this.fileName, TestSuiteHelper.UploadFileName);

            Site.Assert.IsTrue(
                isAddFileSuccessful,
                "AddFile operation returns {0}, TRUE means the operation was executed successfully," +
                " FALSE means the operation failed",
                isAddFileSuccessful);

            // Check out and check in file one time to create a new version of the file.
            this.testSuiteHelper.AddOneFileVersion(this.fileName);

            // Enforce the file to be checked out.
            bool setServerEnforceCheckOut = this.sutControlAdapterInstance.SetEnforceCheckout(this.documentLibrary, true);

            Site.Assert.IsTrue(
                setServerEnforceCheckOut,
                "SetServerEnforceCheckOut operation returns {0}, TRUE means the operation was executed successfully," +
                " FALSE means the operation failed",
                setServerEnforceCheckOut);

            // Call GetVersions operation using relative fileName.
            GetVersionsResponseGetVersionsResult getVersionsResponse = this.protocolAdapterInstance.GetVersions(
                url);

            // Verify the GetVersions results.
            this.testSuiteHelper.VerifyResultsInformation(getVersionsResponse.results, OperationName.GetVersions, true);

            // Check out the specified file.
            bool isCheckOutFile = this.listsSutControlAdaterInstance.CheckoutFile(this.fileAbsoluteUrl);

            Site.Assert.IsTrue(
                isCheckOutFile,
                "CheckOutFile operation returns {0}, TRUE means the operation was executed successfully," +
                " FALSE means the operation failed",
                isCheckOutFile);

            // Get the current version of the file.
            string currentVersionBeforeRestore = AdapterHelper.GetCurrentVersion(getVersionsResponse.results.result);

            // Get the previous version which is specific to be restored.
            string restoreVersion = AdapterHelper.GetPreviousVersion(getVersionsResponse.results.result);

            // Call RestoreVersion operation using relative fileName and restore a specified file to a specific version.
            RestoreVersionResponseRestoreVersionResult restoreVersionReponse = this.protocolAdapterInstance.RestoreVersion(
                url, restoreVersion);

            // Check in the specified file.
            bool isCheckInFile = this.listsSutControlAdaterInstance.CheckInFile(
                this.fileAbsoluteUrl,
                TestSuiteHelper.FileComments,
                ((int)VersionType.MinorCheckIn).ToString());

            Site.Assert.IsTrue(
                isCheckInFile,
                "CheckInFile operation returns {0}, TRUE means the operation was executed successfully," +
                " FALSE means the operation failed",
                isCheckInFile);

            // Verify the RestoreVersion results.
            this.testSuiteHelper.VerifyResultsInformation(restoreVersionReponse.results, OperationName.RestoreVersion, true);

            // Get the current version in RestoreVersion response.
            string currentVersionAfterRestore = AdapterHelper.GetCurrentVersion(restoreVersionReponse.results.result);

            // Verify whether the current version was increased by RestoreVersion.
            bool isCurrentVersionIncreased = AdapterHelper.IsCurrentVersionIncreased(
                currentVersionBeforeRestore,
                currentVersionAfterRestore);

            // Add the debug information
            Site.Log.Add(
                LogEntryKind.Debug,
                "Verify MS-VERSS_R182, the current version before RestoreVersion is {0}, and after RestoreVersion is {1}",
                currentVersionBeforeRestore,
                currentVersionAfterRestore);

            // Verify MS-VERSS requirement: MS-VERSS_R182
            Site.CaptureRequirementIfIsTrue(
                isCurrentVersionIncreased,
                182,
                @"[In RestoreVersion] After the restoration, the current version number of the file MUST still be increased, as with any other change.");
        }
        /// <summary>
        /// A common method used to verify that the client can get expected DeleteAllVersionsSoapOut and
        /// GetVersionsSoapOut messages by calling DeleteAllVersions and GetVersions operations with the URL of a file.
        /// </summary>
        /// <param name="url">The URL of a file.</param>
        private void DeleteAllVersionsVerification(string url)
        {
            // Enable the versioning of the list.
            bool setVersioning = this.sutControlAdapterInstance.SetVersioning(this.documentLibrary, true, true);

            Site.Assert.IsTrue(
                setVersioning,
                "SetVersioning operation returns {0}, TRUE means the operation was executed successfully, " +
                "FALSE means the operation failed",
                setVersioning);

            // Upload the file into specific list.
            bool isAddFileSuccessful = this.sutControlAdapterInstance.AddFile(this.documentLibrary, this.fileName, TestSuiteHelper.UploadFileName);

            Site.Assert.IsTrue(
                isAddFileSuccessful,
                "AddFile operation returns {0}, TRUE means the operation was executed successfully, " +
                " FALSE means the operation failed",
                isAddFileSuccessful);

            // Check out and check in file one time to create a new version of the file.
            this.testSuiteHelper.AddOneFileVersion(this.fileName);

            // Call SUT Control Adapter method SetFilePublish to publish the current version of the file.
            bool isFilePublished = this.sutControlAdapterInstance.SetFilePublish(this.documentLibrary, this.fileName, true);

            Site.Assert.IsTrue(
                isFilePublished,
                "SetFilePublish operation returns {0}, TRUE means the operation was executed successfully," +
                " FALSE means the operation failed",
                isFilePublished);

            // Call GetVersions with the relative filename to get details about all versions of the file.
            GetVersionsResponseGetVersionsResult getVersionsResponse = this.protocolAdapterInstance.GetVersions(url);

            // Verify the GetVersions response results.
            this.testSuiteHelper.VerifyResultsInformation(getVersionsResponse.results, OperationName.GetVersions, true);

            // Get previous version before DeleteAllVersions operation by using the results element in the response of GetVersions.
            string previousVersion = AdapterHelper.GetPreviousVersion(getVersionsResponse.results.result);

            // Get the published version information by using the results element in the response of GetVersions.
            string publishedVersion = AdapterHelper.GetCurrentVersion(getVersionsResponse.results.result);

            // Check out and check in file one time to create a new version of the file.
            this.testSuiteHelper.AddOneFileVersion(this.fileName);

            // Call GetVersions with the relative filename to get details about all versions of the file.
            getVersionsResponse = this.protocolAdapterInstance.GetVersions(url);

            // Get the current version information by using the results element in the response of GetVersions.
            string currentVersion = AdapterHelper.GetCurrentVersion(getVersionsResponse.results.result);

            // Enable the Recycle Bin.
            bool isRecycleBinEnable = this.sutControlAdapterInstance.SetRecycleBinEnable(true);

            Site.Assert.IsTrue(
                isRecycleBinEnable,
                "SetRecycleBinEnable operation returns {0}, TRUE means the operation was executed successfully," +
                " FALSE means the operation failed",
                isRecycleBinEnable);

            // Call DeleteAllVersions operation with the relative filename to delete all the previous versions except
            // the published version and the current version.
            DeleteAllVersionsResponseDeleteAllVersionsResult deleteAllVersionsResponse =
                this.protocolAdapterInstance.DeleteAllVersions(url);

            // Verify DeleteAllVersions response results.
            this.testSuiteHelper.VerifyResultsInformation(deleteAllVersionsResponse.results, OperationName.DeleteAllVersions, true);

            // Verify whether the published version and the current version exist in the results element in the response
            // of DeleteAllVersions.
            bool isCurrentVersionExist =
                AdapterHelper.IsVersionExist(deleteAllVersionsResponse.results.result, currentVersion);
            bool isPublishedVersionExist = AdapterHelper.IsVersionExist(
                deleteAllVersionsResponse.results.result,
                publishedVersion);

            Site.Assert.IsTrue(
                isCurrentVersionExist,
                "The DeleteAllVersions operation should not delete the current version {0}",
                currentVersion);

            Site.Assert.IsTrue(
                isPublishedVersionExist,
                "The DeleteAllVersions operation should not delete the published version {0}",
                publishedVersion);

            // Verify whether the previous version exists in the results element in the response of DeleteAllVersions.
            bool isPreviousVersionExist = AdapterHelper.IsVersionExist(deleteAllVersionsResponse.results.result, previousVersion);

            Site.Assert.IsFalse(
                isPreviousVersionExist,
                "The DeleteAllVersions operation should delete the previous version {0}",
                previousVersion);

            // Since all the previous versions of the specified file do not exist, except for the published version and the current version, capture requirement MS-VERSS_R79.
            Site.CaptureRequirement(
                79,
                @"[In DeleteAllVersions operation] The DeleteAllVersions operation deletes all the previous versions of the specified file, except for the published version and the current version. ");

            bool isDeleteFileVersionExistInRecycleBin = false;
            bool isDeleted = false;

            foreach (VersionData versionData in getVersionsResponse.results.result)
            {
                isDeleted = !AdapterHelper.IsVersionExist(deleteAllVersionsResponse.results.result, versionData.version);
                if (isDeleted)
                {
                    // Verify whether the deleted versions exist in the Recycle Bin.
                    isDeleteFileVersionExistInRecycleBin = this.sutControlAdapterInstance.IsFileExistInRecycleBin(
                        this.fileName,
                        versionData.version);

                    if (!isDeleteFileVersionExistInRecycleBin)
                    {
                        break;
                    }
                }
            }

            // Verify MS-VERSS requirement: MS-VERSS_R169
            Site.CaptureRequirementIfIsTrue(
                isDeleteFileVersionExistInRecycleBin,
                169,
                @"[In DeleteAllVersions operation] If the Recycle Bin is enabled, the versions are placed in the Recycle Bin, instead.");
        }
        public void MSVERSS_S02_TC03_RestoreVersionWithoutEnforceCheckout()
        {
            // Enable the versioning of the list.
            bool setVersioning = this.sutControlAdapterInstance.SetVersioning(this.documentLibrary, true, true);

            Site.Assert.IsTrue(
                setVersioning,
                "SetVersioning operation returns {0}, TRUE means the operation was executed successfully," +
                " FALSE means the operation failed",
                setVersioning);

            // Protocol server does not enforce that only checked out files can be modified.
            bool isSetServerEnforceCheckOut = this.sutControlAdapterInstance.SetEnforceCheckout(this.documentLibrary, false);

            Site.Assert.IsTrue(
                isSetServerEnforceCheckOut,
                "SetServerEnforceCheckOut operation returns {0}, TRUE means the operation was executed successfully," +
                " FALSE means the operation failed",
                isSetServerEnforceCheckOut);

            // Upload the first file into specific list.
            bool isAddFileSuccessful = this.sutControlAdapterInstance.AddFile(this.documentLibrary, this.fileName, TestSuiteHelper.UploadFileName);

            Site.Assert.IsTrue(
                isAddFileSuccessful,
                "AddFile operation returns {0}, TRUE means the operation was executed successfully," +
                " FALSE means the operation failed",
                isAddFileSuccessful);

            // Check out and check in first file to add the file versions.
            this.testSuiteHelper.AddOneFileVersion(this.fileName);

            // Call GetVersions operation using absolute fileName.
            GetVersionsResponseGetVersionsResult getVersionsResponse = this.protocolAdapterInstance.GetVersions(this.fileAbsoluteUrl.AbsoluteUri);

            // Verify the GetVersions results.
            this.testSuiteHelper.VerifyResultsInformation(getVersionsResponse.results, OperationName.GetVersions, true);

            // Get the current version.
            string currentVersionBeforeRestore = AdapterHelper.GetCurrentVersion(getVersionsResponse.results.result);

            // Get the previous version which is specific to be restored.
            string restoreVersion = AdapterHelper.GetPreviousVersion(getVersionsResponse.results.result);

            // Call RestoreVersion operation using absolute fileName and restore a specified file to a specific version.
            RestoreVersionResponseRestoreVersionResult restoreVersionNotCheckOutResponse =
                this.protocolAdapterInstance.RestoreVersion(this.fileAbsoluteUrl.AbsoluteUri, restoreVersion);

            // Verify the RestoreVersion results.
            this.testSuiteHelper.VerifyResultsInformation(restoreVersionNotCheckOutResponse.results, OperationName.RestoreVersion, true);

            // Get the current version in RestoreVersion response.
            string currentVersionAfterNotCheckOutRestore = AdapterHelper.GetCurrentVersion(
                restoreVersionNotCheckOutResponse.results.result);

            // Verify whether the current version after RestoreVersion is increased when the file is not checked out.
            bool isCurrentVersionIncreased = AdapterHelper.IsCurrentVersionIncreased(
                currentVersionBeforeRestore,
                currentVersionAfterNotCheckOutRestore);

            // Add the debug information
            Site.Log.Add(
                LogEntryKind.Debug,
                "Verify MS-VERSS_R185, if the file is not checked out, the current version before RestoreVersion is {0}," +
                " and after RestoreVersion is {1}",
                currentVersionBeforeRestore,
                currentVersionAfterNotCheckOutRestore);

            // Verify MS-VERSS requirement: MS-VERSS_R185
            Site.CaptureRequirementIfIsTrue(
                isCurrentVersionIncreased,
                185,
                @"[In RestoreVersion] If the file is not checked out before the restoration, the current version number of the file MUST still be increased, as with any other change.");

            // Check out the file.
            bool isCheckOutFile = this.listsSutControlAdaterInstance.CheckoutFile(this.fileAbsoluteUrl);

            Site.Assert.IsTrue(
                isCheckOutFile,
                "CheckOutFile operation returns {0}, TRUE means the operation was executed successfully," +
                " FALSE means the operation failed",
                isCheckOutFile);

            // Call GetVersions operation using absolute fileName.
            getVersionsResponse = this.protocolAdapterInstance.GetVersions(this.fileAbsoluteUrl.AbsoluteUri);

            // Get current version before RestoreVersion operation in GetVersions response.
            currentVersionBeforeRestore = AdapterHelper.GetCurrentVersion(getVersionsResponse.results.result);

            // Get the previous version which is specific to be restored.
            restoreVersion = AdapterHelper.GetPreviousVersion(getVersionsResponse.results.result);

            // Call RestoreVersion operation using absolute fileName and restore a specified file to a specific version.
            RestoreVersionResponseRestoreVersionResult restoreVersionIsCheckOutResponse =
                this.protocolAdapterInstance.RestoreVersion(this.fileAbsoluteUrl.AbsoluteUri, restoreVersion);

            // Get the current version in RestoreVersion response.
            string currentVersionAfterIsCheckOutRestore = AdapterHelper.GetCurrentVersion(
                restoreVersionIsCheckOutResponse.results.result);

            // Add the debug information
            Site.Log.Add(
                LogEntryKind.Debug,
                "Verify MS-VERSS_R186, if the file is checked out, the current version before RestoreVersion is {0}," +
                " and after RestoreVersion is {1}",
                currentVersionBeforeRestore,
                currentVersionAfterIsCheckOutRestore);

            // Verify MS-VERSS requirement: MS-VERSS_R186
            Site.CaptureRequirementIfAreEqual <string>(
                currentVersionBeforeRestore,
                currentVersionAfterIsCheckOutRestore,
                186,
                @"[In RestoreVersion] If the file is checked out, the current version number of the file after restoration MUST remain the same as before restoration.");

            // Check in file.
            bool isCheckInFile = this.listsSutControlAdaterInstance.CheckInFile(
                this.fileAbsoluteUrl,
                TestSuiteHelper.FileComments,
                ((int)VersionType.MinorCheckIn).ToString());

            Site.Assert.IsTrue(
                isCheckInFile,
                "CheckInFile operation returns {0}, TRUE means the operation was executed successfully," +
                " FALSE means the operation failed",
                isCheckInFile);
        }
        /// <summary>
        /// A common method used to verify that the client can get expected DeleteVersionSoapOut and
        /// GetVersionsSoapOut messages by calling DeleteVersion and GetVersions operations with the URL of a file.
        /// </summary>
        /// <param name="url">The URL of a file.</param>
        private void DeleteVersionVerification(string url)
        {
            // Enable the versioning of the list.
            bool setVersioning = this.sutControlAdapterInstance.SetVersioning(this.documentLibrary, true, true);

            Site.Assert.IsTrue(
                setVersioning,
                "SetVersioning operation returns {0}, TRUE means the operation was executed successfully," +
                " FALSE means the operation failed",
                setVersioning);

            // Upload the file into specific list.
            bool isAddFileSuccessful = this.sutControlAdapterInstance.AddFile(this.documentLibrary, this.fileName, TestSuiteHelper.UploadFileName);

            Site.Assert.IsTrue(
                isAddFileSuccessful,
                "AddFile operation returns {0}, TRUE means the operation was executed successfully," +
                " FALSE means the operation failed",
                isAddFileSuccessful);

            // Check out and check in file one time to create a new version of the file.
            this.testSuiteHelper.AddOneFileVersion(this.fileName);

            // Call GetVersions with the relative filename to get details about all versions of the file.
            GetVersionsResponseGetVersionsResult getVersionsResponse =
                this.protocolAdapterInstance.GetVersions(url);

            // Verify the GetVersions response results.
            this.testSuiteHelper.VerifyResultsInformation(getVersionsResponse.results, OperationName.GetVersions, true);

            // Get the current version information by using the results element in the response of GetVersions.
            string currentVersion = AdapterHelper.GetCurrentVersion(getVersionsResponse.results.result);

            // Enable the Recycle Bin.
            bool isRecycleBinEnable = this.sutControlAdapterInstance.SetRecycleBinEnable(true);

            Site.Assert.IsTrue(
                isRecycleBinEnable,
                "SetRecycleBinEnable operation returns {0}, TRUE means the operation was executed successfully," +
                " FALSE means the operation failed",
                isRecycleBinEnable);

            // Get the version that needs to be deleted.
            string deleteFileVersion = AdapterHelper.GetPreviousVersion(getVersionsResponse.results.result);

            // Call DeleteVersion to delete a specific version of the file by using the relative filename.
            DeleteVersionResponseDeleteVersionResult deleteVersionResponse =
                this.protocolAdapterInstance.DeleteVersion(url, deleteFileVersion);

            // Verify DeleteVersion response results.
            this.testSuiteHelper.VerifyResultsInformation(deleteVersionResponse.results, OperationName.DeleteVersion, true);

            // Check whether the current version exists in the DeleteVersion response.
            bool isCurrentVersionExist =
                AdapterHelper.IsVersionExist(deleteVersionResponse.results.result, currentVersion);

            Site.Assert.IsTrue(
                isCurrentVersionExist,
                "The DeleteVersion operation should not delete the current version {0}",
                currentVersion);

            // Check whether the deleted version exists in the Recycle Bin.
            bool isDeleteFileVersionExistInRecycleBin =
                this.sutControlAdapterInstance.IsFileExistInRecycleBin(this.fileName, deleteFileVersion);

            // Verify MS-VERSS requirement: MS-VERSS_R173
            Site.CaptureRequirementIfIsTrue(
                isDeleteFileVersionExistInRecycleBin,
                173,
                @"[In DeleteVersion operation] If the Recycle Bin is enabled, the version is placed in the Recycle Bin, instead.");
        }