-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into feature/migration-to-net8
- Loading branch information
Showing
13 changed files
with
519 additions
and
111 deletions.
There are no files selected for viewing
80 changes: 80 additions & 0 deletions
80
...tions/ObservableKeyGroupsCollectionTest/ObservableKeyGroupsCollectionTestsCountChanged.cs
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,80 @@ | ||
// Developed by Softeq Development Corporation | ||
// http://www.softeq.com | ||
|
||
using Xunit; | ||
using CollectionHelper = Softeq.XToolkit.Common.Tests.Collections.ObservableKeyGroupsCollectionTest.ObservableKeyGroupsCollectionHelper; | ||
|
||
namespace Softeq.XToolkit.Common.Tests.Collections.ObservableKeyGroupsCollectionTest; | ||
|
||
public class ObservableKeyGroupsCollectionTestsCountChanged | ||
{ | ||
[Fact] | ||
public void AddGroups_KeysOnlyForbidEmptyGroupCorrectKeys_RaisesPropertyChangedForCount() | ||
{ | ||
var collection = CollectionHelper.CreateFilledGroupsWithoutEmpty(); | ||
var pairs = CollectionHelper.PairNotContainedKeyWithItems; | ||
|
||
Assert.PropertyChanged(collection, nameof(collection.Count), () => | ||
{ | ||
collection.AddGroups(pairs); | ||
}); | ||
} | ||
|
||
[Fact] | ||
public void InsertGroups_KeysOnlyForbidEmptyGroupCorrectKeys_RaisesPropertyChangedForCount() | ||
{ | ||
var collection = CollectionHelper.CreateFilledGroupsWithoutEmpty(); | ||
var pairs = CollectionHelper.PairNotContainedKeyWithItems; | ||
|
||
Assert.PropertyChanged(collection, nameof(collection.Count), () => | ||
{ | ||
collection.InsertGroups(0, pairs); | ||
}); | ||
} | ||
|
||
[Fact] | ||
public void ReplaceAllGroups_KeysOnlyAllowEmptyGroupCorrectKeys_RaisesPropertyChangedForCount() | ||
{ | ||
var collection = CollectionHelper.CreateFilledGroupsWithEmpty(); | ||
var keys = CollectionHelper.KeysEmpty; | ||
|
||
Assert.PropertyChanged(collection, nameof(collection.Count), () => | ||
{ | ||
collection.ReplaceAllGroups(keys); | ||
}); | ||
} | ||
|
||
[Fact] | ||
public void ReplaceAllGroups_KeysOnlyAllowEmptyGroupEmptyCollection_RaisesPropertyChangedForCount() | ||
{ | ||
var collection = CollectionHelper.CreateFilledGroupsWithEmpty(); | ||
var pairs = CollectionHelper.PairsEmpty; | ||
|
||
Assert.PropertyChanged(collection, nameof(collection.Count), () => | ||
{ | ||
collection.ReplaceAllGroups(pairs); | ||
}); | ||
} | ||
|
||
[Fact] | ||
public void RemoveGroups_KeysOnlyForbidEmptyGroupContainsKey_RaisesPropertyChangedForCount() | ||
{ | ||
var collection = CollectionHelper.CreateFilledGroupsWithoutEmpty(); | ||
|
||
Assert.PropertyChanged(collection, nameof(collection.Count), () => | ||
{ | ||
collection.RemoveGroups(CollectionHelper.KeysOneFill); | ||
}); | ||
} | ||
|
||
[Fact] | ||
public void Clear_FilledCollection_RaisesPropertyChangedForCount() | ||
{ | ||
var collection = CollectionHelper.CreateFilledGroupsWithoutEmpty(); | ||
|
||
Assert.PropertyChanged(collection, nameof(collection.Count), () => | ||
{ | ||
collection.Clear(); | ||
}); | ||
} | ||
} |
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.