Some cosmetic changes; all methods in the StringBuilderHelper are now extension methods; added GarbagePolicy enumeration for StringBuilder helper methods; custom Semaphore is not internal in Windows builds to avoid ambiguous symbols
git-svn-id: file:///srv/devel/repo-conversion/nusu@263 d2e56fa2-650e-0410-a79f-9358c0239efd
This commit is contained in:
parent
1a05bf9d63
commit
07a9de6283
13 changed files with 495 additions and 103 deletions
|
@ -194,6 +194,35 @@ namespace Nuclex.Support.Collections {
|
|||
Assert.IsFalse(set2.IsSubsetOf(set1));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verifies that a set can determine if another set overlaps with it
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void CanDetermineOverlap() {
|
||||
var set1 = new ObservableSet<int>() { 1, 3, 5 };
|
||||
var set2 = new ObservableSet<int>() { 3 };
|
||||
|
||||
Assert.IsTrue(set1.Overlaps(set2));
|
||||
Assert.IsTrue(set2.Overlaps(set1));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verifies that a set can determine if another set contains the same elements
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void CanDetermineSetEquality() {
|
||||
var set1 = new ObservableSet<int>() { 1, 3, 5 };
|
||||
var set2 = new ObservableSet<int>() { 3, 1, 5 };
|
||||
|
||||
Assert.IsTrue(set1.SetEquals(set2));
|
||||
Assert.IsTrue(set2.SetEquals(set1));
|
||||
|
||||
set1.Add(7);
|
||||
|
||||
Assert.IsFalse(set1.SetEquals(set2));
|
||||
Assert.IsFalse(set2.SetEquals(set1));
|
||||
}
|
||||
|
||||
/// <summary>Creates mock object for the test</summary>
|
||||
private MockFactory mockFactory;
|
||||
/// <summary>Observable set being tested</summary>
|
||||
|
|
|
@ -37,9 +37,9 @@ namespace Nuclex.Support.Collections {
|
|||
ISet<TItem>,
|
||||
ICollection<TItem>,
|
||||
#if !NO_SPECIALIZED_COLLECTIONS
|
||||
INotifyCollectionChanged,
|
||||
INotifyCollectionChanged,
|
||||
#endif
|
||||
IObservableCollection<TItem> {
|
||||
IObservableCollection<TItem> {
|
||||
|
||||
/// <summary>Raised when an item has been added to the collection</summary>
|
||||
public event EventHandler<ItemEventArgs<TItem>> ItemAdded;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue