Microsoft.Protocols.TestSuites.MS_MEETS.S04_RecurringMeeting.MSMEETS_S04_TC01_RecurringMeetingOperations C# (CSharp) Method

MSMEETS_S04_TC01_RecurringMeetingOperations() private method

private MSMEETS_S04_TC01_RecurringMeetingOperations ( ) : void
return void
        public void MSMEETS_S04_TC01_RecurringMeetingOperations()
        {
            // Create 3 workspaces.
            string emptyWorkspaceTitle = TestSuiteBase.GetUniqueWorkspaceTitle();
            SoapResult<CreateWorkspaceResponseCreateWorkspaceResult> createWorkspaceResult = this.meetsAdapter.CreateWorkspace(emptyWorkspaceTitle, null, null, null);
            Site.Assert.IsNull(createWorkspaceResult.Exception, "Create workspace should succeed");
            string emptyWorkspaceUrl = createWorkspaceResult.Result.CreateWorkspace.Url;

            string singleWorkspaceTitle = TestSuiteBase.GetUniqueWorkspaceTitle();
            createWorkspaceResult = this.meetsAdapter.CreateWorkspace(singleWorkspaceTitle, null, null, null);
            Site.Assert.IsNull(createWorkspaceResult.Exception, "Create workspace should succeed");
            string singleMeetingWorkspaceUrl = createWorkspaceResult.Result.CreateWorkspace.Url;

            string recurringWorkspaceTitle = TestSuiteBase.GetUniqueWorkspaceTitle();
            createWorkspaceResult = this.meetsAdapter.CreateWorkspace(recurringWorkspaceTitle, null, null, null);
            Site.Assert.IsNull(createWorkspaceResult.Exception, "Create workspace should succeed");
            string recurringMeetingWorkspaceUrl = createWorkspaceResult.Result.CreateWorkspace.Url;

            // Add a single instance meeting in the single meeting workspace.
            this.meetsAdapter.Url = singleMeetingWorkspaceUrl + Common.GetConfigurationPropertyValue("EntryUrl", this.Site);

            string organizerEmail = Common.GetConfigurationPropertyValue("OrganizerEmail", this.Site);
            string meetingTitle = TestSuiteBase.GetUniqueMeetingTitle();
            string meetingLocation = TestSuiteBase.GetUniqueMeetingLocation();
            SoapResult<AddMeetingResponseAddMeetingResult> addMeeting = this.meetsAdapter.AddMeeting(organizerEmail, Guid.NewGuid().ToString(), null, DateTime.Now, meetingTitle, meetingLocation, DateTime.Now, DateTime.Now.AddHours(1), null);
            Site.Assert.IsNull(addMeeting.Exception, "AddMeeting should succeed");

            // Add a recurring meeting in the recurring meeting workspace.
            this.meetsAdapter.Url = recurringMeetingWorkspaceUrl + Common.GetConfigurationPropertyValue("EntryUrl", this.Site);
            string icalendar = TestSuiteBase.GetICalendar(Guid.NewGuid().ToString(), true);

            SoapResult<AddMeetingFromICalResponseAddMeetingFromICalResult> addMeetingFromICalResult = this.meetsAdapter.AddMeetingFromICal(organizerEmail, icalendar);
            Site.Assert.IsNull(addMeetingFromICalResult.Exception, "AddMeetingFromICal should succeed");

            // Send GetMeetingsInformation to the empty workspace.
            this.meetsAdapter.Url = emptyWorkspaceUrl + Common.GetConfigurationPropertyValue("EntryUrl", this.Site);
            SoapResult<GetMeetingsInformationResponseGetMeetingsInformationResult> emptyInfoResult = this.meetsAdapter.GetMeetingsInformation(MeetingInfoTypes.QueryOthers, null);
            Site.Assert.IsNull(emptyInfoResult.Exception, "GetMeetingsInformation should succeed");
            Site.Assert.AreEqual<string>("0", emptyInfoResult.Result.MeetingsInformation.WorkspaceStatus.MeetingCount, "Workspace should not contain meeting instance.");

            // Send GetMeetingsInformation to the single meeting workspace.
            this.meetsAdapter.Url = singleMeetingWorkspaceUrl + Common.GetConfigurationPropertyValue("EntryUrl", this.Site);
            SoapResult<GetMeetingsInformationResponseGetMeetingsInformationResult> singleInfoResult = this.meetsAdapter.GetMeetingsInformation(MeetingInfoTypes.QueryOthers, null);
            Site.Assert.IsNull(singleInfoResult.Exception, "GetMeetingsInformation should succeed");
            Site.Assert.AreEqual<string>("1", singleInfoResult.Result.MeetingsInformation.WorkspaceStatus.MeetingCount, "Workspace should contain only 1 meeting instance.");

            // Send GetMeetingsInformation to the recurring meeting workspace.
            this.meetsAdapter.Url = recurringMeetingWorkspaceUrl + Common.GetConfigurationPropertyValue("EntryUrl", this.Site);
            SoapResult<GetMeetingsInformationResponseGetMeetingsInformationResult> recurringInfoResult = this.meetsAdapter.GetMeetingsInformation(MeetingInfoTypes.QueryOthers, null);
            Site.Assert.IsNull(recurringInfoResult.Exception, "GetMeetingsInformation should succeed");

            // If the MeetingCount that server returns is -1, MS-MEETS_R215 is verified.
            Site.CaptureRequirementIfAreEqual<string>(
                "-1",
                recurringInfoResult.Result.MeetingsInformation.WorkspaceStatus.MeetingCount,
                215,
                @"[In GetMeetingsInformationResponse]This [MeetingCount]MUST be set to -1 if the meeting workspace subsite has a recurring meeting.");         

            // Send GetMeetingWorkspaces to the parent web site.
            this.meetsAdapter.Url = Common.GetConfigurationPropertyValue("TargetServiceUrl", this.Site);

            // Get available workspace for non-recurring meeting, server should return the first and second workspaces.
            SoapResult<GetMeetingWorkspacesResponseGetMeetingWorkspacesResult> getMeetingWorkspacesResult = this.meetsAdapter.GetMeetingWorkspaces(false);
            Site.Assert.IsNull(getMeetingWorkspacesResult.Exception, "GetMeetingWorkspaces should succeed");

            // If only empty workspaces and single instance workspaces are returned, MS-MEETS_R230 is verified.
            Site.CaptureRequirementIfAreEqual<int>(
                2,
                getMeetingWorkspacesResult.Result.MeetingWorkspaces.Length,
                230,
                @"[In GetMeetingWorkspaces][If the value [of recurring]is false], empty workspaces and single instance workspaces are returned.");

            // If only workspaces to which the protocol client can add meetings are returned, MS-MEETS_R224 is verified.
            Site.CaptureRequirementIfAreEqual<int>(
                2,
                getMeetingWorkspacesResult.Result.MeetingWorkspaces.Length,
                224,
                @"[In GetMeetingWorkspacesSoapOut]The protocol server MUST return only workspaces to which the protocol client can add meetings.");

            getMeetingWorkspacesResult = this.meetsAdapter.GetMeetingWorkspaces(null);
            Site.Assert.IsNull(getMeetingWorkspacesResult.Exception, "GetMeetingWorkspaces should succeed");

            // If only empty workspaces and single instance workspaces are returned, MS-MEETS_R2311 is verified.
            Site.CaptureRequirementIfAreEqual<int>(
                2,
                getMeetingWorkspacesResult.Result.MeetingWorkspaces.Length,
                2311,
                @"[In GetMeetingWorkspaces]If [the value of recurring is] not specified, the server will treat it as false.");

            // Get available workspace for recurring meeting, server should only return the first workspace
            getMeetingWorkspacesResult = this.meetsAdapter.GetMeetingWorkspaces(true);
            Site.Assert.IsNull(getMeetingWorkspacesResult.Exception, "GetMeetingWorkspaces should succeed");

            // If only empty workspaces are returned, MS-MEETS_R231 is verified.
            Site.CaptureRequirementIfAreEqual<int>(
                1,
                getMeetingWorkspacesResult.Result.MeetingWorkspaces.Length,
                231,
                @"[In GetMeetingWorkspaces]If [the value of recurring is]true, only empty workspaces are returned.");

            // Clean up the SUT.
            this.meetsAdapter.Url = emptyWorkspaceUrl + Common.GetConfigurationPropertyValue("EntryUrl", this.Site);
            SoapResult<Null> deleteResult = this.meetsAdapter.DeleteWorkspace();
            Site.Assert.IsNull(deleteResult.Exception, "DeleteWorkspace should succeed");

            this.meetsAdapter.Url = singleMeetingWorkspaceUrl + Common.GetConfigurationPropertyValue("EntryUrl", this.Site);
            deleteResult = this.meetsAdapter.DeleteWorkspace();
            Site.Assert.IsNull(deleteResult.Exception, "DeleteWorkspace should succeed");

            this.meetsAdapter.Url = recurringMeetingWorkspaceUrl + Common.GetConfigurationPropertyValue("EntryUrl", this.Site);
            deleteResult = this.meetsAdapter.DeleteWorkspace();
            Site.Assert.IsNull(deleteResult.Exception, "DeleteWorkspace should succeed");
        }