-
Notifications
You must be signed in to change notification settings - Fork 233
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #185 from rianjs/PeriodSortingAndEquality
Fixed some bugs when comparing collections of periods (PeriodList) and
- Loading branch information
Showing
29 changed files
with
339 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using Ical.Net.DataTypes; | ||
using Ical.Net.Interfaces.DataTypes; | ||
using NUnit.Framework; | ||
|
||
namespace Ical.Net.UnitTests | ||
{ | ||
internal class CollectionHelpersTests | ||
{ | ||
private static readonly DateTime _now = DateTime.UtcNow; | ||
private static readonly DateTime _later = _now.AddHours(1); | ||
private static readonly string _uid = Guid.NewGuid().ToString(); | ||
|
||
private static List<IRecurrencePattern> GetSimpleRecurrenceList() | ||
=> new List<IRecurrencePattern> { new RecurrencePattern(FrequencyType.Daily, 1) { Count = 5 } }; | ||
private static List<IPeriodList> GetExceptionDates() | ||
=> new List<IPeriodList> { new PeriodList { new Period(new CalDateTime(_now.AddDays(1).Date)) } }; | ||
|
||
[Test] | ||
public void ExDateTests() | ||
{ | ||
Assert.AreEqual(GetExceptionDates(), GetExceptionDates()); | ||
Assert.AreNotEqual(GetExceptionDates(), null); | ||
Assert.AreNotEqual(null, GetExceptionDates()); | ||
|
||
var changedPeriod = GetExceptionDates(); | ||
changedPeriod.First().First().StartTime = new CalDateTime(_now.AddHours(-1)); | ||
|
||
Assert.AreNotEqual(GetExceptionDates(), changedPeriod); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.