Microsoft.Protocols.TestSuites.MS_OXNSPI.S05_NegativeBehavior.MSOXNSPI_S05_TC30_GetTemplateInfoFailedWithInvalidLocale C# (CSharp) Method

MSOXNSPI_S05_TC30_GetTemplateInfoFailedWithInvalidLocale() private method

        public void MSOXNSPI_S05_TC30_GetTemplateInfoFailedWithInvalidLocale()
        {
            this.CheckProductSupported();
            this.CheckMAPIHTTPTransportSupported();

            #region Call NspiBind to initiate a session between the client and the server.
            uint flags = 0;
            STAT stat = new STAT();
            stat.InitiateStat();
            FlatUID_r guid = new FlatUID_r
            {
                Ab = new byte[16]
            };
            FlatUID_r? serverGuid = guid;

            this.Result = this.ProtocolAdatper.NspiBind(flags, stat, ref serverGuid);
            Site.Assert.AreEqual<ErrorCodeValue>(ErrorCodeValue.Success, this.Result, "NspiBind should return success!");
            #endregion

            #region Call NspiGetTemplateInfo with the input parameter pDN set to NULL and the input parameter dwLocaleID set to an invalid value, so that the server cannot locate the object specified by the invalid dwLocaleID.
            string dn = null;
            uint locateID = 0x0; // An invalid value which does not specify any LCID according to [MS-LCID].
            uint flagsOfGetTemplateInfo = (uint)NspiGetTemplateInfoFlag.TI_HELPFILE_NAME;
            uint type = (uint)DisplayTypeValue.DT_MAILUSER;
            uint codePage = stat.CodePage;
            PropertyRow_r? data;

            this.Result = this.ProtocolAdatper.NspiGetTemplateInfo(flagsOfGetTemplateInfo, type, dn, codePage, locateID, out data);

            #region Capture

            this.VerifyWhetherppDataIsNullForNspiGetTemplateInfo(data);

            // Add the debug information
            Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXNSPI_R1476");

            // Verify MS-OXNSPI requirement: MS-OXNSPI_R1476
            Site.CaptureRequirementIfAreEqual<ErrorCodeValue>(
                ErrorCodeValue.InvalidLocale,
                this.Result,
                1476,
                @"[In NspiGetTemplateInfo] [Server Processing Rules: Upon receiving message NspiGetTemplateInfo, the server MUST process the data from the message subject to the following constraints:] [Constraint 5] If the server is unable to locate a specific object based on these constraints [constraints 1-4], the server MUST return the value ""InvalidLocale"".");

            // Add the debug information
            Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCDATA_R975");

            // Verify MS-OXCDATA requirement: MS-OXCDATA_R975
            Site.CaptureRequirementIfAreEqual<ErrorCodeValue>(
                ErrorCodeValue.InvalidLocale,
                this.Result,
                "MS-OXCDATA",
                975,
                @"[In Error Codes] InvalidLocale(MAPI_E_UNKNOWN_LCID) will be returned, if the server is not configured to support the locale
                requested by the client.");

            // Add the debug information
            Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCDATA_R976");

            // Verify MS-OXCDATA requirement: MS-OXCDATA_R976
            Site.CaptureRequirementIfAreEqual<uint>(
                0x8004011F,
                (uint)this.Result,
                "MS-OXCDATA",
                976,
                @"[In Error Codes] The numeric value (hex) for error code InvalidLocale is 0x8004011F, %x1F.01.04.80.");

            #endregion Capture
            #endregion

            #region Call NspiUnbind to destroy the session between the client and the server.
            uint returnValue = this.ProtocolAdatper.NspiUnbind(0);
            Site.Assert.AreEqual<uint>(1, returnValue, "NspiUnbind method should return 1 (Success).");
            #endregion
        }
S05_NegativeBehavior