Example #1
0
        public SharingLevelOfDetails(BaseFolderType folder)
        {
            this.currentLevel = LevelOfDetails.Unknown;
            CalendarFolderType calendarFolderType = folder as CalendarFolderType;

            if (calendarFolderType == null)
            {
                ContactsFolderType contactsFolderType = folder as ContactsFolderType;
                if (contactsFolderType != null)
                {
                    switch (contactsFolderType.SharingEffectiveRights)
                    {
                    case PermissionReadAccessType.None:
                        this.currentLevel = LevelOfDetails.None;
                        return;

                    case PermissionReadAccessType.FullDetails:
                        this.currentLevel = LevelOfDetails.Full;
                        break;

                    default:
                        return;
                    }
                }
                return;
            }
            switch (calendarFolderType.SharingEffectiveRights)
            {
            case CalendarPermissionReadAccessType.None:
                this.currentLevel = LevelOfDetails.None;
                return;

            case CalendarPermissionReadAccessType.TimeOnly:
                this.currentLevel = LevelOfDetails.Availability;
                return;

            case CalendarPermissionReadAccessType.TimeAndSubjectAndLocation:
                this.currentLevel = LevelOfDetails.Limited;
                return;

            case CalendarPermissionReadAccessType.FullDetails:
                this.currentLevel = LevelOfDetails.Full;
                return;

            default:
                return;
            }
        }
        public void MSOXWSFOLD_S04_TC02_GetContactsFolder()
        {
            #region Get the contacts folder.

            DistinguishedFolderIdType folder = new DistinguishedFolderIdType();
            folder.Id = DistinguishedFolderIdNameType.contacts;

            // GetFolder request.
            GetFolderType getContactsFolderRequest = this.GetGetFolderRequest(DefaultShapeNamesType.AllProperties, folder);

            // Get the Contacts folder.
            GetFolderResponseType getContactsFolderResponse = this.FOLDAdapter.GetFolder(getContactsFolderRequest);

            // Check the response.
            Common.CheckOperationSuccess(getContactsFolderResponse, 1, this.Site);

            // Variable to save the folder.
            FolderInfoResponseMessageType allFolders = (FolderInfoResponseMessageType)getContactsFolderResponse.ResponseMessages.Items[0];

            #endregion

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

            // Verify MS-OXWSFOLD requirement: MS-OXWSFOLD_R31
            this.Site.CaptureRequirementIfIsInstanceOfType(
                allFolders.Folders[0],
                typeof(ContactsFolderType),
                31,
                @"[In t:ArrayOfFoldersType Complex Type]The type of element ContactsFolder is t:ContactsFolderType ([MS-OXWSCONT] section 3.1.4.1.1.6).");

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

            // Verify MS-OXWSFOLD requirement: MS-OXWSFOLD_R3301
            this.Site.CaptureRequirementIfIsInstanceOfType(
                allFolders.Folders[0],
                typeof(ContactsFolderType),
                3301,
                @"[In t:ArrayOfFoldersType Complex Type]ContactsFolder represents a Contacts folder in a mailbox.");

            ContactsFolderType folderInfo = (ContactsFolderType)allFolders.Folders[0];

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

            // Verify MS-OXWSFOLD requirement: MS-OXWSFOLD_R69
            // Folder class value is returned from server and schema has verified in adapter, so this requirement can be covered.
            this.Site.CaptureRequirementIfIsNotNull(
                folderInfo.FolderClass,
                69,
                @"[In t:BaseFolderType Complex Type]The type of element FolderClass is xs:string [XMLSCHEMA2].");

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

            // Verify MS-OXWSFOLD_R585.
            Site.CaptureRequirementIfAreEqual <string>(
                "IPF.Contact",
                folderInfo.FolderClass,
                585,
                @"[In t:BaseFolderType Complex Type]This value[FolderClass] MUST be ""IPF.Contact"" for Contacts folders.");

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

            // Verify MS-OXWSFOLD requirement: MS-OXWSFOLD_R7101
            this.Site.CaptureRequirementIfAreEqual <string>(
                "Contacts",
                folderInfo.DisplayName,
                7101,
                @"[In t:BaseFolderType Complex Type]DisplayName specifies the display name of the folder.");

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

            // Verify MS-OXWSFOLD requirement: MS-OXWSFOLD_R71
            // Folder display name is returned from server and schema has verified in adapter, so this requirement can be covered.
            this.Site.CaptureRequirementIfIsNotNull(
                folderInfo.DisplayName,
                71,
                @"[In t:BaseFolderType Complex Type]The type of element DisplayName is xs:string.");

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

            // Verify MS-OXWSFOLD requirement: MS-OXWSFOLD_R66
            // Folder id is returned from server and schema has verified in adapter, so this requirement can be covered.
            this.Site.CaptureRequirementIfIsNotNull(
                folderInfo.FolderId,
                66,
                @"[In t:BaseFolderType Complex Type]The type of element FolderId is t:FolderIdType ([MS-OXWSCDATA] section 2.2.4.36).");

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

            // Verify MS-OXWSFOLD requirement: MS-OXWSFOLD_R6602
            // Folder id is returned from server and schema is verified in adapter so this requirement can be covered.
            this.Site.CaptureRequirementIfIsNotNull(
                folderInfo.FolderId,
                6602,
                @"[In t:BaseFolderType Complex Type]FolderId specifies the folder identifier and change key.");
        }