当前位置: 首页>>代码示例>>C#>>正文


C# Schedule.GetXMLEvents方法代码示例

本文整理汇总了C#中Schedule.GetXMLEvents方法的典型用法代码示例。如果您正苦于以下问题:C# Schedule.GetXMLEvents方法的具体用法?C# Schedule.GetXMLEvents怎么用?C# Schedule.GetXMLEvents使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Schedule的用法示例。


在下文中一共展示了Schedule.GetXMLEvents方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: VerifyParsingBadDatesToSchedule

 public void VerifyParsingBadDatesToSchedule()
 {
     List<string> filenames = new List<string>();
     filenames.Add("Tests\\Data\\GoodXML_malformedDate.xml");
     var schedule = new Schedule();
     var _emptyEvents = new ObservableCollection<Event>();
     ObservableCollection<Event> Events = schedule.GetXMLEvents(true, filenames); //read from xap
     Assert.IsNotNull(Events);
     //events with malformed dates should be added to the schedule with a fake date
     Assert.AreNotEqual(_emptyEvents, Events);
     Assert.IsNotNull(Events, "event collection");
     var enumerator = Events.GetEnumerator();
     enumerator.MoveNext();
     var firstEvent = enumerator.Current;
     Assert.IsNotNull(firstEvent, "first event in collection");
     Assert.AreEqual("Panel", firstEvent.Kind);
     Assert.AreEqual("Datetime 08272011 110000", firstEvent.Name);
     Assert.IsNotNull(firstEvent.StartTime, "datetime");
     Assert.AreEqual(TestValues.FriendlyTime, firstEvent.friendlyStartTime);
     Assert.AreEqual(false, firstEvent.Star);
     enumerator.MoveNext();
     var secondEvent = enumerator.Current;
     Assert.IsNotNull(secondEvent, "first event in collection");
     Assert.AreEqual("Panel", secondEvent.Kind);
     Assert.IsNotNull(secondEvent.StartTime, "datetime");
     Assert.AreEqual(TestValues.FriendlyTime, secondEvent.friendlyStartTime);
     Assert.AreEqual("Datetime Friday 10 November", secondEvent.Name);
     Assert.AreEqual(false, secondEvent.Star);
     //check for little watson file in isolated storage?
 }
开发者ID:jacalata,项目名称:pax,代码行数:30,代码来源:ScheduleParseTests.cs

示例2: VerifyParsingMissingXMLToSchedule

 public void VerifyParsingMissingXMLToSchedule()
 {
     List<string> filenames = new List<string>();
     filenames.Add("Tests\\Data\\BadXML_filedoesnotexist.xml");
     var schedule = new Schedule();
     var _emptyEvents = new ObservableCollection<Event>();
     ObservableCollection<Event> Events = schedule.GetXMLEvents(true, filenames); //read from xap
     Assert.IsNotNull(Events, "confirming event collection exists");
     //no file so no events should have been created
     Assert.Equals(_emptyEvents, Events);
 }
开发者ID:jacalata,项目名称:pax,代码行数:11,代码来源:ScheduleParseTests.cs

示例3: VerifyParsingGoodXMLToScheduleEvents

 public void VerifyParsingGoodXMLToScheduleEvents()
 {
     List<string> filenames = new List<string>();
     filenames.Add("Tests\\Data\\GoodXML.xml");
     var schedule = new Schedule();
     ObservableCollection<Event> Events = schedule.GetXMLEvents(true, filenames); //read from xap
     Assert.IsNotNull(Events, "event collection");
     var enumerator = Events.GetEnumerator();
     enumerator.MoveNext();
     var firstEvent = enumerator.Current;
     Assert.IsNotNull(firstEvent, "first event in collection");
     Assert.AreEqual("Contest", firstEvent.Kind);
     Assert.AreEqual("First Test Event", firstEvent.Name);
     Assert.AreEqual(false, firstEvent.Star);
 }
开发者ID:jacalata,项目名称:pax,代码行数:15,代码来源:ScheduleParseTests.cs

示例4: VerifyParsingGoodXMLToSchedule

 public void VerifyParsingGoodXMLToSchedule()
 {
     List<string> filenames = new List<string>();
     filenames.Add("Tests\\Data\\GoodXML.xml");
     var schedule = new Schedule();
     ObservableCollection<Event> Events = schedule.GetXMLEvents(true, filenames); //read from xap
     Assert.IsNotNull(Events, "event collection");
     var _emptyEvents = new ObservableCollection<Event>();
     Assert.AreNotEqual(_emptyEvents, Events);
 }
开发者ID:jacalata,项目名称:pax,代码行数:10,代码来源:ScheduleParseTests.cs

示例5: VerifyParsingConventionDataFile

 public void VerifyParsingConventionDataFile()
 {
     List<string> days = new List<string>();
     var schedule = new Schedule();
      List<string> filenames = new List<string>();
      filenames.Add("XML\\Friday.xml");
      schedule.GetXMLEvents(true, filenames);
      days = schedule.eventDays;
     Assert.AreNotEqual(0, days.Count);
     Assert.IsTrue(days[0].Contains("day"));
 }
开发者ID:jacalata,项目名称:pax,代码行数:11,代码来源:ScheduleParseTests.cs

示例6: VerifyParsingBadXMLToSchedule

 public void VerifyParsingBadXMLToSchedule()
 {
     List<string> filenames = new List<string>();
     filenames.Add("Tests\\Data\\BadXML_ampersand.xml");
     filenames.Add("Tests\\Data\\BadXML_empty.xml");
     var schedule = new Schedule();
     var _emptyEvents = new ObservableCollection<Event>();
     ObservableCollection<Event> Events = schedule.GetXMLEvents(true, filenames); //read from xap
     Assert.IsNotNull(Events, "confirming event collection exists");
     // malformed events should not be added to the schedule
     Assert.Equals(_emptyEvents, Events);
 }
开发者ID:jacalata,项目名称:pax,代码行数:12,代码来源:ScheduleParseTests.cs


注:本文中的Schedule.GetXMLEvents方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。