Microsoft.Protocols.TestSuites.MS_VERSS.S03_ErrorConditions.MSVERSS_S03_TC09_DeleteVersionUsingInvalidCharacters C# (CSharp) Method

MSVERSS_S03_TC09_DeleteVersionUsingInvalidCharacters() private method

        public void MSVERSS_S03_TC09_DeleteVersionUsingInvalidCharacters()
        {
            // The variable is used to save the soap error code returned from server.
            string errorCode = string.Empty;

            // The variable is used to save the soap error string returned from server.
            string errorString = string.Empty;

            // Enable the versioning of the list.
            bool isSetVersionSuccess = this.sutControlAdapterInstance.SetVersioning(this.documentLibrary, true, true);
            Site.Assert.IsTrue(
                isSetVersionSuccess, 
                "SetVersioning operation returns {0}, TRUE means the operation was executed successfully," +
                " FALSE means the operation failed", 
                isSetVersionSuccess);

            // Upload the file into specific list.
            bool isAddFileSuccess =
                this.sutControlAdapterInstance.AddFile(this.documentLibrary, this.fileName, TestSuiteHelper.UploadFileName);
            Site.Assert.IsTrue(
                isAddFileSuccess, 
                "AddFile operation returns {0}, TRUE means the operation was executed successfully," +
                " FALSE means the operation failed", 
                isAddFileSuccess);

            // Check out and check in file six times to create six versions of the file. 
            this.testSuiteHelper.AddFileVersions();
            this.testSuiteHelper.AddFileVersions();

            // The variable is used to save the response of DeleteVersion.
            DeleteVersionResponseDeleteVersionResult deleteVersionResponse;

            // The variable is used to save the invalid characters for file name.
            string[] invalidCharacters = new string[] 
            { 
                "\"", "#", "%", "&", "*", ":", "<", "=", ">", "?",
                "\\", "{", "|", "}", "~", "/", "..", "\t", "\n", "\r" 
            };

            // The variable is used to save the file relative URL that contains "# or ? and file name" 
            // which will be truncated, and '\t' or '\' is at the end of file name. So fileURL is still a valid URL.
            foreach (string truncatedCharacter in invalidCharacters)
            {
                if (truncatedCharacter == "#" || truncatedCharacter == "?" || truncatedCharacter == "\t" || truncatedCharacter == "\\")
                {
                    string fileURL = string.Empty;

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

                    // The variable is used to save the version needs to be deleted.
                    string deleteFileVersion = AdapterHelper.GetPreviousVersion(getVersionsResponse.results.result);

                    if (truncatedCharacter == "\t" || truncatedCharacter == "\\")
                    {
                        fileURL = this.documentLibrary + "/" + this.fileName + truncatedCharacter;
                    }
                    else if (truncatedCharacter == "#" || truncatedCharacter == "?")
                    {
                        fileURL = this.documentLibrary + "/" + this.fileName + truncatedCharacter + this.fileName;
                    }

                    // Call DeleteVersion operation to delete the specified file version via the valid file relative URL.
                    deleteVersionResponse = this.protocolAdapterInstance.DeleteVersion(fileURL, deleteFileVersion);
                    this.testSuiteHelper.VerifyResultsInformation(deleteVersionResponse.results, OperationName.DeleteVersion, true);

                    getVersionsResponse = this.protocolAdapterInstance.GetVersions(this.fileRelativeUrl);
                    bool isVersionDelete = deleteFileVersion != AdapterHelper.GetPreviousVersion(getVersionsResponse.results.result);

                    if (truncatedCharacter == "#")
                    {
                        if (Common.IsRequirementEnabled(197, this.Site))
                        {
                            // Add the debug information
                            Site.Log.Add(LogEntryKind.Debug, "Verify MS-VERSS_R197");

                            // Verify MS-VERSS requirement: MS-VERSS_R197
                            Site.CaptureRequirementIfIsTrue(
                                isVersionDelete,
                                197,
                                @"[In Appendix B: Product Behavior] Implementation does truncates all characters after the first ""#"" in the file name. (<6> Section 3.1.4.2.2.2: Windows SharePoint Services truncates all characters after the first pound sign ""#"" in the file name.)");
                        }
                    }
                    else if (truncatedCharacter == "?")
                    {
                        if (Common.IsRequirementEnabled(19702, this.Site))
                        {
                            // Add the debug information
                            Site.Log.Add(LogEntryKind.Debug, "Verify MS-VERSS_R19702");

                            // Verify MS-VERSS requirement: MS-VERSS_R19702
                            Site.CaptureRequirementIfIsTrue(
                                isVersionDelete,
                                19702,
                                @"[In Appendix B: Product Behavior] Implementation does truncates all characters after the first ""?"" in the file name. (<6> Section 3.1.4.2.2.2: Windows SharePoint Services truncates all characters after the first question mark ""?"" in the file name.)");
                        }
                    }
                    else if (truncatedCharacter == "\t")
                    {
                        if (Common.IsRequirementEnabled(19704, this.Site))
                        {
                            // Add the debug information
                            Site.Log.Add(LogEntryKind.Debug, "Verify MS-VERSS_R19704");

                            // Verify MS-VERSS requirement: MS-VERSS_R19704
                            Site.CaptureRequirementIfIsTrue(
                                isVersionDelete,
                                19704,
                                @"[In Appendix B: Product Behavior] Implementation does not return an error to indicate that the tab (\t) character is at the end of the fileName. (<6> Section 3.1.4.2.2.2: The tab (\t) character is ignored at the end of the fileName on Windows SharePoint Services 3.0, SharePoint Foundation 2010,and SharePoint Foundation 2013.)");
                        }
                    }
                    else if (truncatedCharacter == "\\")
                    {
                        if (Common.IsRequirementEnabled(19705, this.Site))
                        {
                            // Add the debug information
                            Site.Log.Add(LogEntryKind.Debug, "Verify MS-VERSS_R19705");

                            // Verify MS-VERSS requirement: MS-VERSS_R19705
                            Site.CaptureRequirementIfIsTrue(
                                isVersionDelete,
                                19705,
                                @"[In Appendix B: Product Behavior] Implementation does not return an error to indicate that the backward slash (\) character is at the end of the fileName. (<6> Section 3.1.4.2.2.2: The backward slash (\) character is ignored at the end of the fileName on Windows SharePoint Services 3.0, SharePoint Foundation 2010, and SharePoint Foundation 2013.)");
                        }
                    }
                }
            }

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

            // The variable is used to save the version needs to be deleted.
            string deleteFileVersionForVerifyInvalidCharacters = AdapterHelper.GetPreviousVersion(getVersionsResponseForVerifyInvalidCharacters.results.result);

            bool isR17601Enabled = Common.IsRequirementEnabled(17601, this.Site);
            bool isR19602Enabled = Common.IsRequirementEnabled(19602, this.Site);

            if (isR17601Enabled || isR19602Enabled || Common.IsRequirementEnabled(17602, this.Site) || Common.IsRequirementEnabled(19701, this.Site) || Common.IsRequirementEnabled(17621, this.Site)
                || Common.IsRequirementEnabled(19703, this.Site) || Common.IsRequirementEnabled(17600, this.Site) || Common.IsRequirementEnabled(19620, this.Site))
            {
                foreach (string invalidCharacter in invalidCharacters)
                {
                    // The variable is used to save the relative URL with invalid character.
                    string fileRelativeUrlWithInvalidCharacter = this.documentLibrary + "/" +
                        this.fileName.Substring(0, this.fileName.IndexOf(".", System.StringComparison.CurrentCulture)) + invalidCharacter +
                        this.fileName.Substring(this.fileName.IndexOf(".", System.StringComparison.CurrentCulture));

                    try
                    {
                        deleteVersionResponse =
                            this.protocolAdapterInstance.DeleteVersion(fileRelativeUrlWithInvalidCharacter, deleteFileVersionForVerifyInvalidCharacters);
                        Site.Assert.Fail(
                            "The DeleteVersion operation should fail. The invalid character is {0}",
                            invalidCharacter);
                    }
                    catch (SoapException ex)
                    {
                        errorCode = Common.ExtractErrorCodeFromSoapFault(ex);
                        errorString = AdapterHelper.ExtractErrorStringFromSoapFault(ex);
                        Site.Log.Add(LogEntryKind.Debug, "The errorcode is {0},the errorstring is {1}", errorCode, errorString);

                        if (invalidCharacter == "\"")
                        {
                            if (isR17601Enabled)
                            { 
                                // Add the debug information
                                Site.Log.Add(LogEntryKind.Debug, "Verify MS-VERSS_R17603");

                                // Verify MS-VERSS requirement: MS-VERSS_R17603
                                Site.CaptureRequirementIfAreEqual<string>(
                                    "0x81020073",
                                    errorCode,
                                    17603,
                                    @"[In Appendix B: Product Behavior] Implementation does return error code 0x81020073 to indicate that the fileName element of the DeleteVersion element contains invalid character Double quotation mark (""). (SharePoint Foundation 2010 and above follow this behavior.)");
                            }

                            if (isR19602Enabled)
                            {
                                // Verify MS-VERSS requirement: MS-VERSS_R19603
                                Site.CaptureRequirementIfAreEqual<string>(
                                   "0x81070970",
                                   errorCode,
                                   19603,
                                   @"[In Appendix B: Product Behavior] Implementation does return error code 0x81070970 to indicate that the fileName element of the DeleteVersion element contains invalid character Double quotation mark (""). (<5> Section 3.1.4.2.2.2:  Windows SharePoint Services 3.0 returns the 0x81070970 error code for invalid characters.)");
                            }
                        }
                        else if (invalidCharacter == "#")
                        {
                            if (Common.IsRequirementEnabled(17602, this.Site))
                            {
                                // Add the debug information
                                Site.Log.Add(LogEntryKind.Debug, "Verify MS-VERSS_R17602");

                                Site.CaptureRequirementIfAreEqual<string>(
                                  "0x80131600",
                                  errorCode,
                                  17602,
                                  @"[In Appendix B: Product Behavior] Implementation does return error code 0x80131600. (<6> Section 3.1.4.2.2.2: [Windows SharePoint Services truncates all characters after the first ""#"" in the file name.] If the truncated file name does not exist on the server, 0x80131600 is returned, except that Windows SharePoint Services 3.0 returns a SOAP exception.)");
                            }

                            if (Common.IsRequirementEnabled(19701, this.Site))
                            {
                                // Add the debug information
                                Site.Log.Add(LogEntryKind.Debug, "Verify MS-VERSS_R19701");

                                // Verify MS-VERSS requirement: MS-VERSS_R19701
                                Site.CaptureRequirementIfAreEqual<string>(
                                    "Object reference not set to an instance of an object.",
                                    errorString,
                                    19701,
                                    @"[In Appendix B: Product Behavior] Implementation does return a SOAP exception. (<6> Section 3.1.4.2.2.2: [Windows SharePoint Services truncates all characters after the first ""#"" in the file name.] If the truncated file name does not exist on the server, 0x80131600 is returned, except that Windows SharePoint Services 3.0 returns a SOAP exception.)");
                            }
                        }
                        else if (invalidCharacter == "%")
                        {
                            if (isR17601Enabled)
                            {
                                // Add the debug information
                                Site.Log.Add(LogEntryKind.Debug, "Verify MS-VERSS_R17605");

                                // Verify MS-VERSS requirement: MS-VERSS_R17605
                                Site.CaptureRequirementIfAreEqual<string>(
                                    "0x81020073",
                                    errorCode,
                                    17605,
                                    @"[In Appendix B: Product Behavior] Implementation does return error code 0x81020073 to indicate that the fileName element of the DeleteVersion element contains invalid character Percent sign (%). (SharePoint Foundation 2010 and above follow this behavior.)");
                            }

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

                                // Verify MS-VERSS requirement: MS-VERSS_R19605
                                Site.CaptureRequirementIfAreEqual<string>(
                                    "0x81070970",
                                    errorCode,
                                    19605,
                                    @"[In Appendix B: Product Behavior] Implementation does return error code 0x81070970 to indicate that the fileName element of the DeleteVersion element contains invalid character Percent sign (%). (<5> Section 3.1.4.2.2.2:  Windows SharePoint Services 3.0 returns the 0x81070970 error code for invalid characters.)");
                            }
                        }
                        else if (invalidCharacter == "&")
                        {
                            if (isR17601Enabled)
                            {
                                // Add the debug information
                                Site.Log.Add(LogEntryKind.Debug, "Verify MS-VERSS_R17606");

                                // Verify MS-VERSS requirement: MS-VERSS_R17606
                                Site.CaptureRequirementIfAreEqual<string>(
                                    "0x81020073",
                                    errorCode,
                                    17606,
                                    @"[In Appendix B: Product Behavior] Implementation does return error code 0x81020073 to indicate that the fileName element of the DeleteVersion element contains invalid character Ampersand (&). (SharePoint Foundation 2010 and above follow this behavior.)");
                            }

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

                                // Verify MS-VERSS requirement: MS-VERSS_R19606
                                Site.CaptureRequirementIfAreEqual<string>(
                                    "0x81070970",
                                    errorCode,
                                    19606,
                                    @"[In Appendix B: Product Behavior] Implementation does return error code 0x81070970 to indicate that the fileName element of the DeleteVersion element contains invalid character Ampersand (&). (<5> Section 3.1.4.2.2.2:  Windows SharePoint Services 3.0 returns the 0x81070970 error code for invalid characters.)");
                            }
                        }
                        else if (invalidCharacter == "*")
                        {
                            if (isR17601Enabled)
                            {
                                // Add the debug information
                                Site.Log.Add(LogEntryKind.Debug, "Verify MS-VERSS_R17607");

                                // Verify MS-VERSS requirement: MS-VERSS_R17607
                                Site.CaptureRequirementIfAreEqual<string>(
                                    "0x81020073",
                                    errorCode,
                                    17607,
                                    @"[In Appendix B: Product Behavior] Implementation does return error code 0x81020073 to indicate that the fileName element of the DeleteVersion element contains invalid character Asterisk (*). (SharePoint Foundation 2010 and above follow this behavior.)");
                            }

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

                                // Verify MS-VERSS requirement: MS-VERSS_R19607
                                Site.CaptureRequirementIfAreEqual<string>(
                                    "0x81070970",
                                    errorCode,
                                    19607,
                                    @"[In Appendix B: Product Behavior] Implementation does return error code 0x81070970 to indicate that the fileName element of the DeleteVersion element contains invalid character Asterisk (*). (<5> Section 3.1.4.2.2.2:  Windows SharePoint Services 3.0 returns the 0x81070970 error code for invalid characters.)");
                            }
                        }
                        else if (invalidCharacter == ":")
                        {
                            if (isR17601Enabled)
                            {
                                // Add the debug information
                                Site.Log.Add(LogEntryKind.Debug, "Verify MS-VERSS_R17608");

                                // Verify MS-VERSS requirement: MS-VERSS_R17608
                                Site.CaptureRequirementIfAreEqual<string>(
                                    "0x81020073",
                                    errorCode,
                                    17608,
                                    @"[In Appendix B: Product Behavior] Implementation does return error code 0x81020073 to indicate that the fileName element of the DeleteVersion element contains invalid character Colon (:). (SharePoint Foundation 2010 and above follow this behavior.)");
                            }

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

                                // Verify MS-VERSS requirement: MS-VERSS_R19608
                                Site.CaptureRequirementIfAreEqual<string>(
                                    "0x81070970",
                                    errorCode,
                                    19608,
                                    @"[In Appendix B: Product Behavior] Implementation does return error code 0x81070970 to indicate that the fileName element of the DeleteVersion element contains invalid character Colon (:). (<5> Section 3.1.4.2.2.2:  Windows SharePoint Services 3.0 returns the 0x81070970 error code for invalid characters.)");
                            }
                        }
                        else if (invalidCharacter == "<")
                        {
                            if (isR17601Enabled)
                            {
                                // Add the debug information
                                Site.Log.Add(LogEntryKind.Debug, "Verify MS-VERSS_R17609");

                                // Verify MS-VERSS requirement: MS-VERSS_R17609
                                Site.CaptureRequirementIfAreEqual<string>(
                                    "0x81020073",
                                    errorCode,
                                    17609,
                                    @"[In Appendix B: Product Behavior] Implementation does return error code 0x81020073 to indicate that the fileName element of the DeleteVersion element contains invalid character Left angle bracket (<). (SharePoint Foundation 2010 and above follow this behavior.)");
                            }

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

                                // Verify MS-VERSS requirement: MS-VERSS_R19609
                                Site.CaptureRequirementIfAreEqual<string>(
                                    "0x81070970",
                                    errorCode,
                                    19609,
                                    @"[In Appendix B: Product Behavior] Implementation does return error code 0x81070970 to indicate that the fileName element of the DeleteVersion element contains invalid character Left angle bracket (<). (<5> Section 3.1.4.2.2.2:  Windows SharePoint Services 3.0 returns the 0x81070970 error code for invalid characters.)");
                            }
                        }
                        else if (invalidCharacter == "=")
                        {
                            string sutVersion = Common.GetConfigurationPropertyValue("SutVersion", this.Site);
                            if (sutVersion == "SharePointFoundation2013" || sutVersion == "SharePointServer2013"
                                || sutVersion == "SharePointFoundation2010" || sutVersion == "SharePointServer2010"
                                || sutVersion == "SharePointServer2016")
                            {
                                Site.Assert.AreEqual<string>(
                                    "0x80131600",
                                    errorCode,
                                    "{0} returns error code, the error code is {1}.",
                                    sutVersion,
                                    errorCode);
                            }

                            if (sutVersion == "WindowsSharePointServices3" || sutVersion == "SharePointServer2007")
                            {
                                Site.Assert.IsNull(errorCode, "{0} does not return an error code element, the errorCode is {1}.", sutVersion, errorCode);
                                Site.Assert.IsNotNull(errorString, "{0} returns a SOAP exception without an error code, the errorString is {1}.", sutVersion, errorString);
                            }
                        }
                        else if (invalidCharacter == ">")
                        {
                            if (isR17601Enabled)
                            {
                                // Add the debug information
                                Site.Log.Add(LogEntryKind.Debug, "Verify MS-VERSS_R17611");

                                // Verify MS-VERSS requirement: MS-VERSS_R17611
                                Site.CaptureRequirementIfAreEqual<string>(
                                    "0x81020073",
                                    errorCode,
                                    17611,
                                    @"[In Appendix B: Product Behavior] Implementation does return error code 0x81020073 to indicate that the fileName element of the DeleteVersion element contains invalid character Right angle bracket (>). (SharePoint Foundation 2010 and above follow this behavior.)");
                            }

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

                                // Verify MS-VERSS requirement: MS-VERSS_R19611
                                Site.CaptureRequirementIfAreEqual<string>(
                                    "0x81070970",
                                    errorCode,
                                    19611,
                                    @"[In Appendix B: Product Behavior] Implementation does return error code 0x81070970 to indicate that the fileName element of the DeleteVersion element contains invalid character Right angle bracket (>). (<5> Section 3.1.4.2.2.2:  Windows SharePoint Services 3.0 returns the 0x81070970 error code for invalid characters.)");
                            }
                        }
                        else if (invalidCharacter == "=")
                        {
                            if (isR17601Enabled)
                            {
                                // Add the debug information
                                Site.Log.Add(LogEntryKind.Debug, "Verify MS-VERSS_R17610");

                                // Verify MS-VERSS requirement: MS-VERSS_R17610
                                Site.CaptureRequirementIfAreEqual<string>(
                                    "0x81020073",
                                    errorCode,
                                    17610,
                                    @"[In Appendix B: Product Behavior] Implementation does return error code 0x81020073 to indicate that the fileName element of the DeleteVersion element contains invalid character Equal sign (=). (SharePoint Foundation 2010 and above follow this behavior.)");
                            }
                        }
                        else if (invalidCharacter == "?")
                        {
                            if (Common.IsRequirementEnabled(17621, this.Site))
                            {
                                // Add the debug information
                                Site.Log.Add(LogEntryKind.Debug, "Verify MS-VERSS_R17621");

                                // Verify MS-VERSS requirement: MS-VERSS_R17621
                                Site.CaptureRequirementIfAreEqual<string>(
                                    "0x80131600",
                                    errorCode,
                                    17621,
                                    @"[In Appendix B: Product Behavior] Implementation does return error code 0x80131600. (<6> Section 3.1.4.2.2.2: [Windows SharePoint Services truncates all characters after the first ""?"" in the file name.] If the truncated file name does not exist on the server, 0x80131600 is returned, except that Windows SharePoint Services 3.0 returns a SOAP exception.)");
                            }

                            if (Common.IsRequirementEnabled(19703, this.Site))
                            {
                                // Add the debug information
                                Site.Log.Add(LogEntryKind.Debug, "Verify MS-VERSS_R19703");

                                // Verify MS-VERSS requirement: MS-VERSS_R19703
                                Site.CaptureRequirementIfAreEqual<string>(
                                    "Object reference not set to an instance of an object.",
                                    errorString,
                                    19703,
                                    @"[In Appendix B: Product Behavior] Implementation does return a SOAP exception. (<6> Section 3.1.4.2.2.2: [Windows SharePoint Services truncates all characters after the first ""?"" in the file name.] If the truncated file name does not exist on the server, 0x80131600 is returned, except that Windows SharePoint Services 3.0 returns a SOAP exception.)");
                            }
                        }
                        else if (invalidCharacter == "{")
                        {
                            if (isR17601Enabled)
                            {
                                // Add the debug information
                                Site.Log.Add(LogEntryKind.Debug, "Verify MS-VERSS_R17614");

                                // Verify MS-VERSS requirement: MS-VERSS_R17614
                                Site.CaptureRequirementIfAreEqual<string>(
                                    "0x81020073",
                                    errorCode,
                                    17614,
                                    @"[In Appendix B: Product Behavior] Implementation does return error code 0x81020073 to indicate that the fileName element of the DeleteVersion element contains invalid character Left curly bracket ({). (SharePoint Foundation 2010 and above follow this behavior.)");
                            }

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

                                // Verify MS-VERSS requirement: MS-VERSS_R19614
                                Site.CaptureRequirementIfAreEqual<string>(
                                    "0x81070970",
                                    errorCode,
                                    19614,
                                    @"[In Appendix B: Product Behavior] Implementation does return error code 0x81070970 to indicate that the fileName element of the DeleteVersion element contains invalid character Left curly bracket ({). (<5> Section 3.1.4.2.2.2:  Windows SharePoint Services 3.0 returns the 0x81070970 error code for invalid characters.)");
                            }
                        }
                        else if (invalidCharacter == "|")
                        {
                            if (isR17601Enabled)
                            {
                                // Add the debug information
                                Site.Log.Add(LogEntryKind.Debug, "Verify MS-VERSS_R17615");

                                // Verify MS-VERSS requirement: MS-VERSS_R17615
                                Site.CaptureRequirementIfAreEqual<string>(
                                    "0x81020073",
                                    errorCode,
                                    17615,
                                    @"[In Appendix B: Product Behavior] Implementation does return error code 0x81020073 to indicate that the fileName element of the DeleteVersion element contains invalid character Vertical bar (|). (SharePoint Foundation 2010 and above follow this behavior.)");
                            }

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

                                // Verify MS-VERSS requirement: MS-VERSS_R19615
                                Site.CaptureRequirementIfAreEqual<string>(
                                    "0x81070970",
                                    errorCode,
                                    19615,
                                    @"[In Appendix B: Product Behavior] Implementation does return error code 0x81070970 to indicate that the fileName element of the DeleteVersion element contains invalid character Vertical bar (|). (<5> Section 3.1.4.2.2.2:  Windows SharePoint Services 3.0 returns the 0x81070970 error code for invalid characters.)");
                            }
                        }
                        else if (invalidCharacter == "}")
                        {
                            if (isR17601Enabled)
                            {
                                // Add the debug information
                                Site.Log.Add(LogEntryKind.Debug, "Verify MS-VERSS_R17616");

                                // Verify MS-VERSS requirement: MS-VERSS_R17616
                                Site.CaptureRequirementIfAreEqual<string>(
                                    "0x81020073",
                                    errorCode,
                                    17616,
                                    @"[In Appendix B: Product Behavior] Implementation does return error code 0x81020073 to indicate that the fileName element of the DeleteVersion element contains invalid character Right curly bracket (}). (SharePoint Foundation 2010 and above follow this behavior.)");
                            }

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

                                // Verify MS-VERSS requirement: MS-VERSS_R19616
                                Site.CaptureRequirementIfAreEqual<string>(
                                    "0x81070970",
                                    errorCode,
                                    19616,
                                    @"[In Appendix B: Product Behavior] Implementation does return error code 0x81070970 to indicate that the fileName element of the DeleteVersion element contains invalid character Right curly bracket (}). (<5> Section 3.1.4.2.2.2:  Windows SharePoint Services 3.0 returns the 0x81070970 error code for invalid characters.)");
                            }
                        }
                        else if (invalidCharacter == "~")
                        {
                            if (isR17601Enabled)
                            {
                                // Add the debug information
                                Site.Log.Add(LogEntryKind.Debug, "Verify MS-VERSS_R17617");

                                // Verify MS-VERSS requirement: MS-VERSS_R17617
                                Site.CaptureRequirementIfAreEqual<string>(
                                    "0x81020073",
                                    errorCode,
                                    17617,
                                    @"[In Appendix B: Product Behavior] Implementation does return error code 0x81020073 to indicate that the fileName element of the DeleteVersion element contains invalid character Tilde (~). (SharePoint Foundation 2010 and above follow this behavior.)");
                            }

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

                                // Verify MS-VERSS requirement: MS-VERSS_R19617
                                Site.CaptureRequirementIfAreEqual<string>(
                                    "0x81070970",
                                    errorCode,
                                    19617,
                                    @"[In Appendix B: Product Behavior] Implementation does return error code 0x81070970 to indicate that the fileName element of the DeleteVersion element contains invalid character Tilde (~). (<5> Section 3.1.4.2.2.2:  Windows SharePoint Services 3.0 returns the 0x81070970 error code for invalid characters.)");
                            }
                        }
                        else if (invalidCharacter == "/")
                        {
                            if (isR17601Enabled)
                            {
                                // Add the debug information
                                Site.Log.Add(LogEntryKind.Debug, "Verify MS-VERSS_R17604");

                                // Verify MS-VERSS requirement: MS-VERSS_R17604
                                Site.CaptureRequirementIfAreEqual<string>(
                                    "0x81020073",
                                    errorCode,
                                    17604,
                                    @"[In Appendix B: Product Behavior] Implementation does return error code 0x81020073 to indicate that the fileName element of the DeleteVersion element contains invalid character Forward slash (/). (SharePoint Foundation 2010 and above follow this behavior.)");
                            }

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

                                // Verify MS-VERSS requirement: MS-VERSS_R19604
                                Site.CaptureRequirementIfAreEqual<string>(
                                    "0x81070970",
                                    errorCode,
                                    19604,
                                    @"[In Appendix B: Product Behavior] Implementation does return error code 0x81070970 to indicate that the fileName element of the DeleteVersion element contains invalid character Forward slash (/). (<5> Section 3.1.4.2.2.2:  Windows SharePoint Services 3.0 returns the 0x81070970 error code for invalid characters.)");
                            }
                        }
                        else if (invalidCharacter == "..")
                        {
                            if (isR17601Enabled)
                            {
                                // Add the debug information
                                Site.Log.Add(LogEntryKind.Debug, "Verify MS-VERSS_R17618");

                                // Verify MS-VERSS requirement: MS-VERSS_R17618
                                Site.CaptureRequirementIfAreEqual<string>(
                                    "0x81020073",
                                    errorCode,
                                    17618,
                                    @"[In Appendix B: Product Behavior] Implementation does return error code 0x81020073 to indicate that the fileName element of the DeleteVersion element contains invalid character Two consecutive dots (..). (SharePoint Foundation 2010 and above follow this behavior.)");
                            }

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

                                // Verify MS-VERSS requirement: MS-VERSS_R19618
                                Site.CaptureRequirementIfAreEqual<string>(
                                    "0x81070970",
                                    errorCode,
                                    19618,
                                    @"[In Appendix B: Product Behavior] Implementation does return error code 0x81070970 to indicate that the fileName element of the DeleteVersion element contains invalid character Two consecutive dots (..). (<5> Section 3.1.4.2.2.2:  Windows SharePoint Services 3.0 returns the 0x81070970 error code for invalid characters.)");
                            }
                        }
                        else if (invalidCharacter == "\t")
                        {
                            if (Common.IsRequirementEnabled(17600, this.Site))
                            {
                                // Verify MS-VERSS requirement: MS-VERSS_R17600
                                Site.CaptureRequirementIfAreEqual<string>(
                                    "0x81020073",
                                    errorCode,
                                    17600,
                                    @"[In Appendix B: Product Behavior] Implementation does return error code 0x81020073 to indicate that the fileName element of the DeleteVersion element contains invalid  character Tab (\t) character, it is not at the end of the fileName. (SharePoint Foundation 2010 and above follow this behavior.)");
                            }

                            if (Common.IsRequirementEnabled(19620, this.Site))
                            {
                                // Verify MS-VERSS requirement: MS-VERSS_R19620
                                Site.CaptureRequirementIfAreEqual<string>(
                                    "0x81070970",
                                    errorCode,
                                    19620,
                                    @"[In Appendix B: Product Behavior] Implementation does return error code 0x81070970 to indicate that the fileName element of the DeleteVersion element contains invalid character Tab (\t) character, it is not at the end of the fileName. (<5> Section 3.1.4.2.2.2:  Windows SharePoint Services 3.0 returns the 0x81070970 error code for invalid characters.)");
                            }
                        }
                        else if (invalidCharacter == "\n" || invalidCharacter == "\r")
                        {
                            if (isR17601Enabled)
                            {
                                // Add the debug information
                                Site.Log.Add(LogEntryKind.Debug, "Verify MS-VERSS_R17620");

                                // Verify MS-VERSS requirement: MS-VERSS_R17620
                                Site.CaptureRequirementIfAreEqual<string>(
                                    "0x81020073",
                                    errorCode,
                                    17620,
                                    @"[In Appendix B: Product Behavior] Implementation does return error code 0x81020073 to indicate that the fileName element of the DeleteVersion element contains invalid  character that has a value less than 32 or greater than 126. (SharePoint Foundation 2010 and above follow this behavior.)");
                            }

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

                                // Verify MS-VERSS requirement: MS-VERSS_R19619
                                Site.CaptureRequirementIfAreEqual<string>(
                                    "0x81070970",
                                    errorCode,
                                    19619,
                                    @"[In Appendix B: Product Behavior] Implementation does return error code 0x81070970 to indicate that the fileName element of the DeleteVersion element contains invalid character that has a value less than 32 or greater than 126. (<5> Section 3.1.4.2.2.2:  Windows SharePoint Services 3.0 returns the 0x81070970 error code for invalid characters.)");
                            }
                        }
                    }
                }
            }
        }