Microsoft.Protocols.TestSuites.MS_OXCNOTIF.S02_SubscribeAndReceiveNotifications.VerifyObjectCreatedNotificationElements C# (CSharp) Method

VerifyObjectCreatedNotificationElements() private method

This method is used to verify RopNotify response elements for ObjectCreated event.
private VerifyObjectCreatedNotificationElements ( RopNotifyResponse notifyResponse ) : void
notifyResponse RopNotifyResponse The notification response
return void
        private void VerifyObjectCreatedNotificationElements(RopNotifyResponse notifyResponse)
        {
            // The value 0x0004 of NotificationType means this notification is for ObjectCreated event, 
            // this method is called after notification for ObjectCreated to verify response elements.
            // Add the debug information
            this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCNOTIF_R19501");

            // Verify MS-OXCNOTIF requirement: MS-OXCNOTIF_R19501
            // The value 0x0004 of NotificationType means that notification is for a ObjectCreated event.
            // So if the TagCount in the response is not null, this requirement can be verified.
            this.Site.CaptureRequirementIfIsNotNull(
                notifyResponse.NotificationData.TagCount,
                19501,
                @"[In NotificationData Structure] This field [TagCount] is available if the value of the NotificationType in the NotificationFlags field is 0x0004.");

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

            // Verify MS-OXCNOTIF requirement: MS-OXCNOTIF_R21502
            // The value 0x0004 of NotificationType means that notification is for a ObjectCreated event.
            // So if the MessageFlags in the response is null, this requirement can be verified.
            this.Site.CaptureRequirementIfIsNull(
                notifyResponse.NotificationData.MessageFlags,
                21502,
                @"[In NotificationData Structure] This field [MessageFlags] is not available if the value of the NotificationType in the NotificationFlags field is 0x0004. For details, see [MS-OXCMSG] section 2.2.1.6.");

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

            // Verify MS-OXCNOTIF requirement: MS-OXCNOTIF_R22102
            // The value 0x0004 of NotificationType means that notification is for a ObjectCreated event.
            // So if the UnicodeFlag in the response is null, this requirement can be verified.
            this.Site.CaptureRequirementIfIsNull(
                notifyResponse.NotificationData.UnicodeFlag,
                22102,
                @"[In NotificationData Structure] This field [UnicodeFlag] is not available if the value of the NotificationType field in the NotificationFlags field is 0x0004.");

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

            // Verify MS-OXCNOTIF requirement: MS-OXCNOTIF_R22602
            // The value 0x0004 of NotificationType means that notification is for a ObjectCreated event.
            // So if the MessageClass in the response is null, this requirement can be verified.
            this.Site.CaptureRequirementIfIsNull(
                notifyResponse.NotificationData.MessageClass,
                22602,
                @"[In NotificationData Structure] This field [MessageClass] is not available if the value of the NotificationType in the NotificationFlags field is 0x0004.");

            if ((notifyResponse.NotificationData.NotificationFlags & (ushort)FlagsBit.M) != (ushort)FlagsBit.M && (notifyResponse.NotificationData.NotificationFlags & (ushort)FlagsBit.S) != (ushort)FlagsBit.S)
            {
                // Add the debug information
                this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCNOTIF_R17901");

                // Verify MS-OXCNOTIF requirement: MS-OXCNOTIF_R17901
                this.Site.CaptureRequirementIfIsNotNull(
                    notifyResponse.NotificationData.ParentFolderId,
                    17901,
                    @"[In NotificationData Structure] This field [ParentFolderId] is available if the value of the NotificationType field is 0x0004, and it [RopNotify ROP] is sent for a message in a folder (both bit 0x4000 and bit 0x8000 are not set in the NotificationFlags field).");
            }
        }
S02_SubscribeAndReceiveNotifications