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

MSASCAL_S01_TC08_StartTimePastEndTimeAbsent() private method

private MSASCAL_S01_TC08_StartTimePastEndTimeAbsent ( ) : void
return void
        public void MSASCAL_S01_TC08_StartTimePastEndTimeAbsent()
        {
            #region Call Sync command to add a calendar with the element StartTime setting as past time to the server, and sync calendars from the server.

            Dictionary<Request.ItemsChoiceType8, object> calendarItem = new Dictionary<Request.ItemsChoiceType8, object>();
            string subjectWithPastStartTime = Common.GenerateResourceName(Site, "subject");
            calendarItem.Add(Request.ItemsChoiceType8.Subject, subjectWithPastStartTime);
            calendarItem.Add(Request.ItemsChoiceType8.EndTime, null);
            calendarItem.Add(Request.ItemsChoiceType8.StartTime, this.PastTime.ToString("yyyyMMddTHHmmssZ"));

            this.AddSyncCalendar(calendarItem);

            SyncItem calendarWithPastStartTime = this.GetChangeItem(this.User1Information.CalendarCollectionId, subjectWithPastStartTime);

            Site.Assert.IsNotNull(calendarWithPastStartTime.Calendar, "The calendar with subject {0} should exist in server.", subjectWithPastStartTime);

            this.RecordCaseRelativeItems(this.User1Information.UserName, this.User1Information.CalendarCollectionId, subjectWithPastStartTime);

            #endregion

            Site.Assert.IsNotNull(calendarWithPastStartTime.Calendar.StartTime, "The StartTime element should not be null.");
            Site.Assert.IsNotNull(calendarWithPastStartTime.Calendar.DtStamp, "The DtStamp element should not be null.");
            Site.Assert.IsNotNull(calendarWithPastStartTime.Calendar.EndTime, "The EndTime element should not be null.");

            // Add the debug information
            Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCAL_R52517");

            // Verify MS-ASCAL requirement: MS-ASCAL_R52517
            Site.CaptureRequirementIfIsTrue(
                (calendarWithPastStartTime.Calendar.EndTime.Value - calendarWithPastStartTime.Calendar.DtStamp.Value.AddMinutes(30)).Minutes <= 30 && calendarWithPastStartTime.Calendar.StartTime.Value.ToUniversalTime().ToString("yyyyMMddTHHmmssZ").Equals(this.PastTime.ToString("yyyyMMddTHHmmssZ")),
                52517,
                @"[In Creating Calendar Events when the StartTime Element or EndTime Element is Absent] If StartTime is in the past and EndTime is absent the server sets the value of the StartTime element to the value of the StartTime element in the request and sets the value of the EndTime element to the rounded current time plus 30 minutes.");

            // Add the debug information
            Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCAL_R42911");

            // Verify MS-ASCAL requirement: MS-ASCAL_R42911
            Site.CaptureRequirementIfAreEqual<string>(
                this.PastTime.ToString("yyyyMMddTHHmmssZ"),
                calendarWithPastStartTime.Calendar.StartTime.Value.ToUniversalTime().ToString("yyyyMMddTHHmmssZ"),
                42911,
                @"[In StartTime] As a top-level element of the Calendar class, the StartTime element specifies the start time of the calendar item.");
        }