Microsoft.Protocols.TestSuites.MS_OXORULE.MS_OXORULEAdapter.VerifyStoreObjectEntryID C# (CSharp) Method

VerifyStoreObjectEntryID() private method

Verify the StoreObjectEntryID structure.
private VerifyStoreObjectEntryID ( StoreObjectEntryID storeEntryId ) : void
storeEntryId StoreObjectEntryID The StoreObjectEntryID to be verified.
return void
        private void VerifyStoreObjectEntryID(StoreObjectEntryID storeEntryId)
        {
            // Add the debug information.
            Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCDATA_R2249");

            // Verify MS-OXCDATA requirement: MS-OXCDATA_R2249.
            Site.CaptureRequirementIfAreEqual<uint>(
                0x00000000,
                storeEntryId.Flags,
                "MS-OXCDATA",
                2249,
                @"[In Store Object EntryIDs Structure] Flags (4 bytes): This value MUST be set to 0x00000000.");

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

            // Verify MS-OXCDATA requirement: MS-OXCDATA_R2250.
            bool isVerifyR2250 = Common.CompareByteArray(
                                     storeEntryId.ProviderUID,
                                     new byte[] { 0x38, 0xA1, 0xBB, 0x10, 0x05, 0xE5, 0x10, 0x1A, 0xA1, 0xBB, 0x08, 0x00, 0x2B, 0x2A, 0x56, 0xC2 });

            Site.CaptureRequirementIfIsTrue(
                isVerifyR2250,
                "MS-OXCDATA",
                2250,
                @"[In Store Object EntryID Structure] This value [ProviderUID] is used to route EntryIDs to the correct provider and MUST be set to %x38.A1.BB.10.05.E5.10.1A.A1.BB.08.00.2B.2A.56.C2.");

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

            // Verify MS-OXCDATA requirement: MS-OXCDATA_R2251.
            Site.CaptureRequirementIfAreEqual<byte>(
                0,
                storeEntryId.Version,
                "MS-OXCDATA",
                2251,
                @"[In Store Object EntryIDs Structure] Version (1 byte): This value MUST be set to zero.");

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

            // Verify MS-OXCDATA requirement: MS-OXCDATA_R2252.
            Site.CaptureRequirementIfAreEqual<byte>(
                0,
                storeEntryId.Flag,
                "MS-OXCDATA",
                2252,
                @"[In Store Object EntryIDs Structure] Flag (1 byte): This value MUST be set to zero.");

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

            // Verify MS-OXCDATA requirement: MS-OXCDATA_R2253.
            bool isVerifyR2253 = Common.CompareByteArray(
                                     storeEntryId.DLLFileName,
                                     new byte[] { 0x45, 0x4D, 0x53, 0x4D, 0x44, 0x42, 0x2E, 0x44, 0x4C, 0x4C, 0x00, 0x00, 0x00, 0x00 });

            Site.CaptureRequirementIfIsTrue(
                isVerifyR2253,
                "MS-OXCDATA",
                2253,
                @"[In Store Object EntryIDs Structure] DLLFileName (14 bytes): This field MUST be set to the following value, which represents ""emsmdb.dll"": %x45.4D.53.4D.44.42.2E.44.4C.4C.00.00.00.00.");

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

            // Verify MS-OXCDATA requirement: MS-OXCDATA_R2254.
            Site.CaptureRequirementIfAreEqual<uint>(
                0x00000000,
                storeEntryId.WrappedFlags,
                "MS-OXCDATA",
                2254,
                @"[In Store Object EntryIDs Structure] WrappedFlags (4 bytes): This value MUST be set to 0x00000000.");

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

            // Verify MS-OXCDATA requirement: MS-OXCDATA_R2255.
            bool isVerifyR2255 = Common.CompareByteArray(storeEntryId.WrappedProviderUID, new byte[] { 0x1B, 0x55, 0xFA, 0x20, 0xAA, 0x66, 0x11, 0xCD, 0x9B, 0xC8, 0x00, 0xAA, 0x00, 0x2F, 0xC4, 0x5A }) ||
                                 Common.CompareByteArray(storeEntryId.WrappedProviderUID, new byte[] { 0x1C, 0x83, 0x02, 0x10, 0xAA, 0x66, 0x11, 0xCD, 0x9B, 0xC8, 0x00, 0xAA, 0x00, 0x2F, 0xC4, 0x5A });

            Site.CaptureRequirementIfIsTrue(
                isVerifyR2255,
                "MS-OXCDATA",
                2255,
                @"[In Store Object EntryIDs Structure] WrappedProvider UID (16 bytes): This field MUST be set to one of the values [%x1B.55.FA.20.AA.66.11.CD.9B.C8.00.AA.00.2F.C4.5A,%x1C.83.02.10.AA.66.11.CD.9B.C8.00.AA.00.2F.C4.5A] in the following table.");

            if (storeEntryId.ObjectType == StoreObjectType.Mailbox)
            {
                // Add the debug information.
                Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCDATA_R2256.");

                // Verify MS-OXCDATA requirement: MS-OXCDATA_R2256.
                bool isVerifyR2256 = Common.CompareByteArray(
                                         storeEntryId.WrappedProviderUID,
                                         new byte[] { 0x1B, 0x55, 0xFA, 0x20, 0xAA, 0x66, 0x11, 0xCD, 0x9B, 0xC8, 0x00, 0xAA, 0x00, 0x2F, 0xC4, 0x5A });

                Site.CaptureRequirementIfIsTrue(
                    isVerifyR2256,
                    "MS-OXCDATA",
                    2256,
                    @"[In Store Object EntryIDs Structure] WrappedProvider UID (16 bytes): The store object type is Mailbox Store object, providerUID value is %x1B.55.FA.20.AA.66.11.CD.9B.C8.00.AA.00.2F.C4.5A.");

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

                // Verify MS-OXCDATA requirement: MS-OXCDATA_R2260.
                Site.CaptureRequirementIfAreEqual<uint>(
                    0x0000000C,
                    storeEntryId.WrappedType,
                    "MS-OXCDATA",
                    2260,
                    @"[In Store Object EntryID Structure] For a mailbox store this value [WrappedType] MUST be set to %x0C.00.00.00.");

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

                // Verify MS-OXCDATA requirement: MS-OXCDATA_R2265.
                // If MailboxDN is not null, it means this field is present.
                Site.CaptureRequirementIfIsNotNull(
                    storeEntryId.MailBoxDN,
                    "MS-OXCDATA",
                    2265,
                    @"[In Store Object EntryIDs Structure] MailboxDN (variable): This field is present only for mailbox databases.");

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

                // Remove the "\0" from string.
                StringBuilder mailBoxDN = new StringBuilder();
                for (int i = 0; i < storeEntryId.MailBoxDN.Length - 1; i++)
                {
                    mailBoxDN.Append(storeEntryId.MailBoxDN.ToCharArray()[i]);
                }

                bool isSingleZeroByteTerminated = storeEntryId.MailBoxDN.ToCharArray()[storeEntryId.MailBoxDN.Length - 1] == '\0';
                bool isVerifiedR2264 = Common.IsDNMatchABNF(mailBoxDN.ToString(), DNFormat.X500Dn) && isSingleZeroByteTerminated;

                // Verify MS-OXCDATA requirement: MS-OXCDATA_R2264.
                Site.CaptureRequirementIfIsTrue(
                    isVerifiedR2264,
                    "MS-OXCDATA",
                    2264,
                    @"[In Store Object EntryIDs Structure] MailboxDN (variable):  A string of single-byte characters terminated by a single zero byte and representing the X500 DN of the mailbox, as specified in [MS-OXOAB].");
            }

            // Add the debug information.
            Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCDATA_R2263");
            bool isVerifiedR2263 = storeEntryId.ServerShortname.ToCharArray()[storeEntryId.ServerShortname.Length - 1] == '\0';

            // Verify MS-OXCDATA requirement: MS-OXCDATA_R2263.
            Site.CaptureRequirementIfIsTrue(
                isVerifiedR2263,
                "MS-OXCDATA",
                2263,
                @"[In Store Object EntryIDs Structure] ServerShortname (variable): A string of single-byte characters terminated by a single zero byte, indicating the short name or NetBIOS name of the server.");
        }