Microsoft.Protocols.TestSuites.MS_MEETS.S01_MeetingWorkspace.MSMEETS_S01_TC01_WorkspaceOperations C# (CSharp) Method

MSMEETS_S01_TC01_WorkspaceOperations() private method

private MSMEETS_S01_TC01_WorkspaceOperations ( ) : void
return void
        public void MSMEETS_S01_TC01_WorkspaceOperations()
        {
            // Check whether creating workspace is supported and query available languages.
            SoapResult<GetMeetingsInformationResponseGetMeetingsInformationResult> getWorkspaceInfoResult = this.meetsAdapter.GetMeetingsInformation(MeetingInfoTypes.AllowCreate | MeetingInfoTypes.QueryLanguages, null);
            Site.Assert.IsNull(getWorkspaceInfoResult.Exception, "GetMeetingsInformation should succeed");

            // If AllowCreate is returned and its value is "true" or "false", MS-MEETS_R181, MS-MEETS_R194 can be verified.
            bool isR181R194Verified = getWorkspaceInfoResult.Result.MeetingsInformation.AllowCreate.ToLower(CultureInfo.CurrentCulture) == "true" || getWorkspaceInfoResult.Result.MeetingsInformation.AllowCreate.ToLower(CultureInfo.CurrentCulture) == "false";
            Site.CaptureRequirementIfIsTrue(
                isR181R194Verified,
                181,
                @"[In GetMeetingsInformation]If the value 0x1 is set, the request is to query whether the user has permission to create meeting workspaces on this Web site [the operation is sent to].");

            Site.CaptureRequirementIfIsTrue(
                isR181R194Verified,
                194,
                @"[In GetMeetingsInformationResponse]This element [AllowCreate]is present in the response when bit flag 0x1 is specified in requestFlags.");

            // If ListTemplateLanguages is not null, that is to say, this element is present in the response, then MS-MEETS_R199 can be verified.
            Site.CaptureRequirementIfIsNotNull(
               getWorkspaceInfoResult.Result.MeetingsInformation.ListTemplateLanguages,
               199,
               @"[In GetMeetingsInformationResponse]This element [ListTemplateLanguages]is present in the response when bit flag 0x2 is specified inrequestFlags.");

            // If the operation is executed successfully and ListTemplateLanguages is not null, the returned ListTemplateLanguages represent the languages supported, then MS-MEETS_R182 can be verified.
            Site.CaptureRequirementIfIsNotNull(
                getWorkspaceInfoResult.Result.MeetingsInformation.ListTemplateLanguages,
                182,
                @"[In GetMeetingsInformation]If the value 0x2 is set, the request is to query for the site template languages supported.");
                  
            string lcidString = getWorkspaceInfoResult.Result.MeetingsInformation.ListTemplateLanguages[0];
            uint lcid = 0;
            Site.Assert.IsTrue(uint.TryParse(lcidString, out lcid), "LCID must be integer");

            // Get available workspace templates.
            getWorkspaceInfoResult = this.meetsAdapter.GetMeetingsInformation(MeetingInfoTypes.QueryTemplates, lcid);
            Site.Assert.IsNull(getWorkspaceInfoResult.Exception, "GetMeetingsInformation should succeed");

            // If the operation is executed successfully and ListTemplates is not null, the returned ListTemplates represent the templates supported, then MS-MEETS_R183 can be verified.
            Site.CaptureRequirementIfIsNotNull(
                getWorkspaceInfoResult.Result.MeetingsInformation.ListTemplates,
                183,
                @"[In GetMeetingsInformation]If the value 0x4 is set, the request is to query for the list of site templates supported.");

            // If ListTemplates is not null, that is to say, this element is present in the response, then MS-MEETS_R203 can be verified.
            Site.CaptureRequirementIfIsNotNull(
                getWorkspaceInfoResult.Result.MeetingsInformation.ListTemplates,
                203,
                @"[In GetMeetingsInformationResponse]This element [ListTemplates]is present in the response when bit flag 0x4 is specified in requestFlags.");

            // Add the debug information.
            Site.Log.Add(LogEntryKind.Debug, "If the length of ListTemplates is greater than 0, MS-MEETS_R202, MS-MEETS_R204 can be verified.");

            // If the length of ListTemplates is greater than 0, it is a list for site template and every single template is available template, MS-MEETS_R202, MS-MEETS_R204 can be verified.
            bool isVerifiedR202R204 = getWorkspaceInfoResult.Result.MeetingsInformation.ListTemplates.Length > 0;
            
            Site.CaptureRequirementIfIsTrue(
                isVerifiedR202R204,
                202,
                @"[In GetMeetingsInformationResponse]ListTemplates: The list of site templates supported.");

            Site.CaptureRequirementIfIsTrue(
                isVerifiedR202R204,
                204,
                @"[In GetMeetingsInformationResponse]Template: The available site template.");

            // Create a new workspace using the template from the step above.
            Template template = getWorkspaceInfoResult.Result.MeetingsInformation.ListTemplates[0];
            string workspaceTitle = TestSuiteBase.GetUniqueWorkspaceTitle();
            SoapResult<CreateWorkspaceResponseCreateWorkspaceResult> createWorkspaceResult = this.meetsAdapter.CreateWorkspace(workspaceTitle, template.Name, lcid, null);
            Site.Assert.IsNull(createWorkspaceResult.Exception, "Create workspace should succeed");

            // Get workspaces on the site. Make sure the workspace has been created successfully.
            SoapResult<GetMeetingWorkspacesResponseGetMeetingWorkspacesResult> getWorkspaceResult = this.meetsAdapter.GetMeetingWorkspaces(null);
            Site.Assert.IsNull(getWorkspaceResult.Exception, "GetMeetingWorkspaces should succeed");
            Site.Assert.AreEqual<int>(1, getWorkspaceResult.Result.MeetingWorkspaces.Length, "There should be only 1 workspace.");
            Site.Assert.AreEqual<string>(workspaceTitle, getWorkspaceResult.Result.MeetingWorkspaces[0].Title, "Workspace title should be the same as the request value.");
            this.meetsAdapter.Url = createWorkspaceResult.Result.CreateWorkspace.Url + Common.GetConfigurationPropertyValue("EntryUrl", this.Site);
            
            // Get workspace status. Make sure there is no meetings.
            getWorkspaceInfoResult = this.meetsAdapter.GetMeetingsInformation(MeetingInfoTypes.QueryOthers, null);
            Site.Assert.IsNull(getWorkspaceInfoResult.Exception, "GetMeetingsInformation should succeed");
            Site.Assert.AreEqual<string>("0", getWorkspaceInfoResult.Result.MeetingsInformation.WorkspaceStatus.MeetingCount, "There should be no meetings.");

            // If AllowAuthenticatedUsers is returned and its value is "true" or "false", MS-MEETS_R217 can be verified.
            bool isVerifiedR217 = getWorkspaceInfoResult.Result.MeetingsInformation.WorkspaceStatus.AllowAuthenticatedUsers.ToLower(CultureInfo.CurrentCulture) == "true" || getWorkspaceInfoResult.Result.MeetingsInformation.WorkspaceStatus.AllowAuthenticatedUsers.ToLower(CultureInfo.CurrentCulture) == "false";
            Site.CaptureRequirementIfIsTrue(
                isVerifiedR217,
                217,
                @"[In GetMeetingsInformationResponse]AllowAuthenticatedUsers: Specifies whether access to a meeting workspace subsite has been granted to authenticated users.");

            // AllowAuthenticatedUsers is the status of a workspace, if MS-MEETS_R217 is verified, MS-MEETS_R211 can also be verified. 
            Site.CaptureRequirement(
                211,
                @"[In GetMeetingsInformationResponse]WorkspaceStatus: The status of a workspace.");
            
            // Update the workspace title.
            string newWorkspaceTitle = TestSuiteBase.GetUniqueWorkspaceTitle();
            SoapResult<Null> setWorkspaceTitleResult = this.meetsAdapter.SetWorkspaceTitle(newWorkspaceTitle);
            Site.Assert.IsNull(setWorkspaceTitleResult.Exception, "SetWorkspaceTitle should succeed");

            // Get workspaces on the site. Make sure the workspace title has been updated.
            this.meetsAdapter.Url = Common.GetConfigurationPropertyValue("TargetServiceUrl", this.Site);
            getWorkspaceResult = this.meetsAdapter.GetMeetingWorkspaces(null);
            Site.Assert.IsNull(getWorkspaceResult.Exception, "GetMeetingWorkspaces should succeed");
            Site.Assert.AreEqual<string>(newWorkspaceTitle, getWorkspaceResult.Result.MeetingWorkspaces[0].Title, "Workspace title should set to the new value");

            // Delete the workspace.
            this.meetsAdapter.Url = createWorkspaceResult.Result.CreateWorkspace.Url + Common.GetConfigurationPropertyValue("EntryUrl", this.Site);
            SoapResult<Null> deleteWorkspaceResult = this.meetsAdapter.DeleteWorkspace();
            Site.Assert.IsNull(deleteWorkspaceResult.Exception, "DeleteWorkspace should succeed");

            // Get no workspaces to indicate the workspace has been deleted.
            this.meetsAdapter.Url = Common.GetConfigurationPropertyValue("TargetServiceUrl", this.Site);
            getWorkspaceResult = this.meetsAdapter.GetMeetingWorkspaces(null);
            Site.Assert.IsNull(getWorkspaceResult.Exception, "GetMeetingWorkspaces should succeed");
            Site.Assert.AreEqual<int>(0, getWorkspaceResult.Result.MeetingWorkspaces.Length, "The workspace should be deleted.");
        }