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

MSASCAL_S01_TC25_Status6WithDayOfWeek() private method

private MSASCAL_S01_TC25_Status6WithDayOfWeek ( ) : void
return void
        public void MSASCAL_S01_TC25_Status6WithDayOfWeek()
        {
            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.");

            #region Call Sync command to add a calendar with the element Recurrence including DayOfWeek sub-element when Type is '2' to the server, and sync calendars from the server.

            Dictionary<Request.ItemsChoiceType8, object> calendarItem = new Dictionary<Request.ItemsChoiceType8, object>();

            // Set Calendar Recurrence element
            byte recurrenceType = byte.Parse("2");
            Request.Recurrence recurrence = this.CreateCalendarRecurrence(recurrenceType, 3, 3);

            // Set DayOfWeek
            recurrence.DayOfWeek = 1;
            recurrence.DayOfWeekSpecified = true;

            calendarItem.Add(Request.ItemsChoiceType8.Recurrence, recurrence);

            SyncStore addCalendarResponse1 = this.AddSyncCalendar(calendarItem);

            Site.Assert.AreEqual<string>(
                "6",
                addCalendarResponse1.AddResponses[0].Status,
                "The Sync command response should contain an airsync:Status element with a value of 6 when the DayOfWeek element is included in a request and the Type element value is set to 2.");

            #endregion

            #region Call Sync command to add a calendar with the element Recurrence including DayOfWeek sub-element when Type is '5' to the server, and sync calendars from the server.

            calendarItem.Clear();

            // Set Calendar Recurrence element
            recurrenceType = byte.Parse("5");
            recurrence = this.CreateCalendarRecurrence(recurrenceType, 3, 3);

            // Set DayOfWeek
            recurrence.DayOfWeek = 1;
            recurrence.DayOfWeekSpecified = true;

            calendarItem.Add(Request.ItemsChoiceType8.Recurrence, recurrence);

            SyncStore addCalendarResponse2 = this.AddSyncCalendar(calendarItem);

            Site.Assert.AreEqual<string>(
                "6",
                addCalendarResponse2.AddResponses[0].Status,
                "The Sync command response should contain an airsync:Status element with a value of 6 when the DayOfWeek element is included in a request and the Type element value is set to 5.");

            #endregion

            // According to above steps, requirement MS-ASCAL_R53917 can be covered directly.
            // Add the debug information
            Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCAL_R53917");

            // Verify MS-ASCAL requirement: MS-ASCAL_R53917
            Site.CaptureRequirement(
                53917,
                @"[In Sync Command Response][The Sync command response contains an airsync:Status element ([MS-ASCMD] section 2.2.3.162.16) with a value of 6 in the following cases:] The DayOfWeek element (section 2.2.2.13) is included in a request when the value of the Type element is not 0 (zero), 1, 3, or 6.");
        }