public void MSOXCPERM_S03_TC01_SetUnexpectedPermissionFlags() { this.OxcpermAdapter.InitializePermissionList(); uint getPermissionResponseValue = 0; List <PermissionTypeEnum> permissionList = new List <PermissionTypeEnum>(); RequestBufferFlags bufferFlag = new RequestBufferFlags(); FolderTypeEnum folderType = FolderTypeEnum.CommonFolderType; // Set the right flags that are not specified in the Open Specification. permissionList.Add(PermissionTypeEnum.Reserved20Permission); uint responseValueSetPermission = OxcpermAdapter.AddPermission(folderType, this.User1, bufferFlag, permissionList); permissionList.Clear(); getPermissionResponseValue = OxcpermAdapter.GetPermission(folderType, this.User1, bufferFlag, out permissionList); Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCPERM_R1093: Verify the unexpected permission flags specified in [MS-OXCPERM] section 2.2.7 can't be set. The test case expects that if set the unexpected permission flags, return value is not success or return value is success but actually the flags are not set."); // Verify MS-OXCPERM requirement: MS-OXCPERM_R1093 // If the server fails to set the unexpected flags or the permissions set for the user is empty, it indicates that the server doesn't set the permission flags that are not specified in the Open Specification. bool isR1093Verified = responseValueSetPermission != TestSuiteBase.UINT32SUCCESS || (getPermissionResponseValue == TestSuiteBase.UINT32SUCCESS && permissionList.Count == 0); Site.CaptureRequirementIfIsTrue( isR1093Verified, 1093, @"[In PidTagMemberRights Property] The client and server MUST NOT set any other flags [except ReadAny, Create, EditOwned, DeleteOwned, EditAny, DeleteAny, CreateSubFolder, FolderOwner, FolderContact, FolderVisible, FreeBusySimple, FreeBusyDetailed]."); }
public void MSOXCPERM_S01_TC01_GetFolderPermissionsList() { this.OxcpermAdapter.InitializePermissionList(); // Set the calendar folder type FolderTypeEnum folderType = FolderTypeEnum.CalendarFolderType; uint responseValue = 0; // Set IncludeFreeBusy flag RequestBufferFlags bufferflags = new RequestBufferFlags { IsIncludeFreeBusyFlagSet = true }; List <PermissionTypeEnum> permissionList = new List <PermissionTypeEnum> { PermissionTypeEnum.FreeBusyDetailed, PermissionTypeEnum.FreeBusySimple }; // Add the FreeBusyDetailed and FreeBusySimple to the calendar folder. responseValue = OxcpermAdapter.AddPermission(folderType, this.User1, bufferflags, permissionList); Site.Assert.AreEqual <uint>(TestSuiteBase.UINT32SUCCESS, responseValue, "0 indicates the server adds permission successfully."); // Get the permissions list on the folder permissionList.Clear(); responseValue = OxcpermAdapter.GetPermission(folderType, this.User1, bufferflags, out permissionList); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCPERM_R2014"); // Verify MS-OXCPERM requirement: MS-OXCPERM_R2014 this.Site.CaptureRequirementIfAreEqual <uint>( TestSuiteBase.UINT32SUCCESS, responseValue, 2014, @"[In Processing a RopGetPermissionsTable ROP Request] If the user has permission to view the permissions list of the folder, the server returns the permissions list in a RopQueryRows ROP response buffer ([MS-OXCROPS] section 2.2.5.4). "); // Verify MS-OXCPERM requirement: MS-OXCPERM_R19 bool isR19Verified = permissionList.Contains(PermissionTypeEnum.FreeBusyDetailed) && permissionList.Contains(PermissionTypeEnum.FreeBusySimple); string returnedPermission = this.ConvertFreeBusyStatusToString(permissionList); Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCPERM_R19: If the IncludeFreeBusy is set, the server should return {FreeBusyDetailed, FreeBusySimple}, actually " + returnedPermission); Site.CaptureRequirementIfIsTrue( isR19Verified, 19, @"[In RopGetPermissionsTable ROP Request Buffer] If this flag [IncludeFreeBusy] is set, the server MUST include the values of the FreeBusySimple and FreeBusyDetailed flags of the PidTagMemberRights property in the returned permissions list."); // Remove the user from the permissions list that added in this case responseValue = OxcpermAdapter.RemovePermission(folderType, this.User1, bufferflags); Site.Assert.AreEqual <uint>(TestSuiteBase.UINT32SUCCESS, responseValue, "0 indicates the server removes permission successfully."); }