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

MSASCAL_S01_TC07_StartTimeAbsentEndTimeFuture() private method

private MSASCAL_S01_TC07_StartTimeAbsentEndTimeFuture ( ) : void
return void
        public void MSASCAL_S01_TC07_StartTimeAbsentEndTimeFuture()
        {
            #region Generate calendar subject and record them.

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

            string subjectWithFutureEndTime = Common.GenerateResourceName(Site, "subject");

            #endregion

            #region Call Sync command to add a calendar with the element EndTime setting as future time to the server, and sync calendars from the server.

            calendarItem.Add(Request.ItemsChoiceType8.Subject, subjectWithFutureEndTime);
            calendarItem.Add(Request.ItemsChoiceType8.StartTime, null);

            DateTime futureEndtime = this.FutureTime.AddDays(2);
            calendarItem.Add(Request.ItemsChoiceType8.EndTime, futureEndtime.ToString("yyyyMMddTHHmmssZ"));

            this.AddSyncCalendar(calendarItem);

            SyncItem calendarWithFutureEndTime = this.GetChangeItem(this.User1Information.CalendarCollectionId, subjectWithFutureEndTime);

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

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

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

            // Verify MS-ASCAL requirement: MS-ASCAL_R52516
            Site.CaptureRequirementIfIsTrue(
                (calendarWithFutureEndTime.Calendar.StartTime.Value - calendarWithFutureEndTime.Calendar.DtStamp.Value).Minutes <= 30 && calendarWithFutureEndTime.Calendar.EndTime.Value.ToUniversalTime().ToString("yyyyMMddTHHmmssZ").Equals(futureEndtime.ToString("yyyyMMddTHHmmssZ")),
                52516,
                @"[In Creating Calendar Events when the StartTime Element or EndTime Element is Absent] If StartTime is absent and EndTime is in the future the server sets the value of the StartTime element to the rounded current time and sets the value of the EndTime element to the value of the EndTime element in the request.");

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

            // Verify MS-ASCAL requirement: MS-ASCAL_R23311
            Site.CaptureRequirementIfAreEqual<string>(
                futureEndtime.ToString("yyyyMMddTHHmmssZ"),
                calendarWithFutureEndTime.Calendar.EndTime.Value.ToUniversalTime().ToString("yyyyMMddTHHmmssZ"),
                23311,
                @"[In EndTime] As a top-level element of the Calendar class, the EndTime element specifies the end time of the calendar item.");
        }