Microsoft.Protocols.TestSuites.MS_ASCAL.S01_CalendarElement.MSASCAL_S01_TC36_RecurrenceWithCalendarType1 C# (CSharp) Method

MSASCAL_S01_TC36_RecurrenceWithCalendarType1() private method

private MSASCAL_S01_TC36_RecurrenceWithCalendarType1 ( ) : void
return void
        public void MSASCAL_S01_TC36_RecurrenceWithCalendarType1()
        {
            Site.Assume.AreNotEqual<string>("16.0", Common.GetConfigurationPropertyValue("ActiveSyncProtocolVersion", this.Site), "The recurring calendar item cannot be created when protocol version is set to 16.0. MS-ASProtocolVersion header value is determined using Common PTFConfig property named ActiveSyncProtocolVersion.");
            Site.Assume.AreNotEqual<string>("12.1", Common.GetConfigurationPropertyValue("ActiveSyncProtocolVersion", this.Site), "The element CalendarType is not supported when protocol version is set to 12.1. MS-ASProtocolVersion header value is determined using Common PTFConfig property named ActiveSyncProtocolVersion.");

            #region Generate calendar subject and record them.

            byte recurrenceType = byte.Parse("2");

            Dictionary<Request.ItemsChoiceType8, object> calendarItem = new Dictionary<Request.ItemsChoiceType8, object>();
            
            string subjectWithType2AndCalendarType1 = Common.GenerateResourceName(Site, "subjectWithType2AndCalendarType1");

            #endregion

            #region Call Sync command to add a calendar with the element Recurrence including Type '2' and CalendarType sub-element setting as "1" to the server, and sync calendars from the server.
            int occurrences = 5;
            int interval = 2;

            // Set Calendar Recurrence element, CalendarType is set to "1".
            byte calendarType = byte.Parse("1");
            Request.Recurrence recurrence = this.CreateRecurrenceIncludingCalendarType(this.CreateCalendarRecurrence(recurrenceType, occurrences, interval), calendarType);
            calendarItem.Add(Request.ItemsChoiceType8.Recurrence, recurrence);
            calendarItem.Add(Request.ItemsChoiceType8.Subject, subjectWithType2AndCalendarType1);

            this.AddSyncCalendar(calendarItem);

            SyncItem calendarWithType2AndCalendarType1 = this.GetChangeItem(this.User1Information.CalendarCollectionId, subjectWithType2AndCalendarType1);

            Site.Assert.IsNotNull(calendarWithType2AndCalendarType1.Calendar, "The calendar with subject {0} should exist in server.", subjectWithType2AndCalendarType1);
            this.RecordCaseRelativeItems(this.User1Information.UserName, this.User1Information.CalendarCollectionId, subjectWithType2AndCalendarType1);

            if (Common.IsRequirementEnabled(3, this.Site))
            {
                this.Site.CaptureRequirementIfAreEqual<byte>(
                    0,
                    calendarWithType2AndCalendarType1.Calendar.Recurrence.CalendarType,
                    3,
                    @"[In Appendix B: Product Behavior] The implementation return a value of 0 (Default) when a client specifies a value of 1 (Gregorian). (<1> Section 2.2.2.10:  Microsoft Exchange Server 2013 Service Pack 1 (SP1) returns a value of 0 when a client specifies a value of 1 (Gregorian).)");
            }

            if (Common.IsRequirementEnabled(2239, this.Site))
            {
                this.Site.CaptureRequirementIfAreNotEqual<byte>(
                  0,
                  calendarWithType2AndCalendarType1.Calendar.Recurrence.CalendarType,
                  2239,
                  @"[In Appendix B: Product Behavior] The implementation does not return a value of 0 (Default) when a client specifies a value of 1 (Gregorian). (Microsoft Exchange Server 2010 follows this behavior.)");
            }
            #endregion
        }