public void InsertGroups_WithItemsAllowEmptyGroupsDuplicateKeysWithEmptyItems_ArgumentException() { var collection = CollectionHelper.CreateFilledGroupsWithEmpty(); Assert.Throws <ArgumentException>( () => collection.InsertGroups(0, CollectionHelper.PairDuplicateKeyWithEmptyItem)); }
public void InsertGroups_KeysOnlyForbidEmptyGroup_InvalidOperationException() { var collection = CollectionHelper.CreateFilledGroupsWithoutEmpty(); Assert.Throws <InvalidOperationException>( () => collection.InsertGroups(0, CollectionHelper.KeysNotContained)); }
public void AddGroups_KeysOnlyAllowEmptyGroupsDuplicateKeys_ArgumentException() { var collection = CollectionHelper.CreateWithEmptyGroups(); Assert.Throws <ArgumentException>( () => collection.AddGroups(CollectionHelper.KeysDuplicate)); }
public void ReplaceAllGroups_KeysOnlyAllowEmptyGroupNullKey_ArgumentNullException() { var collection = CollectionHelper.CreateFilledGroupsWithEmpty(); Assert.Throws <ArgumentNullException>( () => collection.ReplaceAllGroups(CollectionHelper.KeysOneNull)); }
public void InsertGroups_KeysOnlyAllowEmptyGroupDuplicateKey_ArgumentException() { var collection = CollectionHelper.CreateFilledGroupsWithEmpty(); Assert.Throws <ArgumentException>( () => collection.InsertGroups(0, CollectionHelper.KeysOneFill)); }
public void InsertGroups_KeysOnlyAllowEmptyGroupNullListOfKeys_ArgumentNullException() { var collection = CollectionHelper.CreateFilledGroupsWithEmpty(); Assert.Throws <ArgumentNullException>( () => collection.InsertGroups(0, CollectionHelper.KeysNull)); }
public void AddGroups_WithItemsForbidEmptyGroupsUniqueKeysWithEmptyItems_InvalidOperationException() { var collection = CollectionHelper.CreateWithoutEmptyGroups(); Assert.Throws <InvalidOperationException>( () => collection.AddGroups(CollectionHelper.PairWithKeyWithEmptyItem)); }
public void AddGroups_KeysOnlyAllowEmptyGroupsNullKey_ArgumentNullException() { var collection = CollectionHelper.CreateWithEmptyGroups(); Assert.Throws <ArgumentNullException>( () => collection.AddGroups(CollectionHelper.KeysOneFillOneNull)); }
public void AddGroups_KeysOnlyForbidEmptyGroup_InvalidOperationException() { var collection = CollectionHelper.CreateWithoutEmptyGroups(); Assert.Throws <InvalidOperationException>( () => collection.AddGroups(CollectionHelper.KeysNull)); }
public void ClearGroup_AllowEmptyGroupMissingKey_KeyNotFoundException() { var collection = CollectionHelper.CreateFilledGroupsWithEmpty(); Assert.Throws <KeyNotFoundException>( () => collection.ClearGroup(CollectionHelper.GroupKeyThird)); }
public void ClearGroup_AllowEmptyGroupNullKey_ArgumentNullException() { var collection = CollectionHelper.CreateFilledGroupsWithEmpty(); Assert.Throws <ArgumentNullException>( () => collection.ClearGroup(null)); }
public void ClearGroup_ForbidEmptyGroup_InvalidOperationException() { var collection = CollectionHelper.CreateFilledGroupsWithoutEmpty(); Assert.Throws <InvalidOperationException>( () => collection.ClearGroup(CollectionHelper.GroupKeyFirst)); }
public void ReplaceAllGroups_WithItemsForbidEmptyGroupsCorrectKeysWithEmptyItems_InvalidOperationException() { var collection = CollectionHelper.CreateFilledGroupsWithoutEmpty(); Assert.Throws <InvalidOperationException>( () => collection.ReplaceAllGroups(CollectionHelper.PairWithKeyWithEmptyItem)); }
public void InsertGroups_KeysOnlyForbidEmptyGroupsOverSizedIndex_ArgumentOutOfRangeException() { var collection = CollectionHelper.CreateFilledGroupsWithEmpty(); Assert.Throws <ArgumentOutOfRangeException>( () => collection.InsertGroups(collection.Keys.Count + 1, CollectionHelper.KeysNotContained)); }
public void InsertItems_ListItemsWithNewKeys_KeyNotFoundException(ObservableKeyGroupsCollection <string, int> collection) { Assert.Throws <KeyNotFoundException>(() => collection.InsertItems( CollectionHelper.CreateFillItemsListWithNewKeys(), x => x.SelectKey(), x => x.SelectValue(), x => x.SelectIndex())); }
public void ReplaceAllGroups_KeysOnlyAllowEmptyGroupEmptyListOfKeys_CollectionIsEmpty() { var collection = CollectionHelper.CreateFilledGroupsWithEmpty(); collection.ReplaceAllGroups(CollectionHelper.KeysEmpty); Assert.Equal(0, collection.Keys.Count); }
public void AddGroups_KeysOnlyAllowEmptyGroupsEmptyListOfKeys_CollectionSizeNotChanged() { var collection = CollectionHelper.CreateWithEmptyGroups(); var expected = collection.Keys.Count; collection.AddGroups(CollectionHelper.KeysEmpty); Assert.Equal(expected, collection.Keys.Count); }
public void InsertItems_SelectNullKey_ArgumentNullException(ObservableKeyGroupsCollection <string, int> collection) { Assert.Throws <ArgumentNullException>( () => collection.InsertItems( CollectionHelper.CreateFillItemsListWithExistKeys(), x => null, x => x.SelectValue(), x => x.SelectIndex())); }
public void InsertItems_NullItem_NullReferenceException(ObservableKeyGroupsCollection <string, int> collection) { Assert.Throws <NullReferenceException>( () => collection.InsertItems( CollectionHelper.CreateFillItemsListWithNull(), x => x.SelectKey(), x => x.SelectValue(), x => x.SelectIndex())); }
public void InsertItems_NullListItems_ArgumentNullException(ObservableKeyGroupsCollection <string, int> collection) { Assert.Throws <ArgumentNullException>( () => collection.InsertItems( CollectionHelper.CreateNullItemsList(), x => x.SelectKey(), x => x.SelectValue(), x => x.SelectIndex())); }
public void InsertItems_NullValueSelector_ArgumentNullException(ObservableKeyGroupsCollection <string, int> collection) { Assert.Throws <ArgumentNullException>( () => collection.InsertItems( CollectionHelper.CreateFillItemsListWithNewKeys(), x => x.SelectKey(), null !, x => x.SelectIndex())); }
public void AddGroups_KeysOnlyAllowEmptyGroupsUniqueKeys_CollectionSizeIncreased() { var collection = CollectionHelper.CreateWithEmptyGroups(); var keys = CollectionHelper.KeysOneFillOneEmpty; var expected = collection.Keys.Count + keys.Count; collection.AddGroups(keys); Assert.Equal(expected, collection.Keys.Count); }
public void AddGroups_WithItemsAllowEmptyGroupsUniqueKeysWithEmptyItems_CollectionSizeIncreased() { var collection = CollectionHelper.CreateWithEmptyGroups(); var pair = CollectionHelper.PairWithKeyWithEmptyItem; var expectedCount = collection.Count + pair.Count; collection.AddGroups(pair); Assert.Equal(expectedCount, collection.Count); }
public void InsertGroups_KeysOnlyAllowEmptyGroupUniqueKey_CollectionSizeIncreased() { var collection = CollectionHelper.CreateFilledGroupsWithEmpty(); var keys = CollectionHelper.KeysNotContained; var expected = collection.Count + keys.Count; collection.InsertGroups(0, keys); Assert.Equal(expected, collection.Keys.Count); }
public void InsertGroups_KeysOnlyAllowEmptyGroupEmptyListOfKeys_CollectionSizeNotChanged() { var collection = CollectionHelper.CreateFilledGroupsWithEmpty(); var keys = CollectionHelper.KeysEmpty; var expected = collection.Count + keys.Count; collection.InsertGroups(0, keys); Assert.Equal(expected, collection.Keys.Count); }
public void InsertGroups_WithItemsAllowEmptyGroupsUniqueKeysWithEmptyItems_CollectionSizeIncreased() { var collection = CollectionHelper.CreateFilledGroupsWithEmpty(); var pair = CollectionHelper.PairNotContainedKeyWithEmptyItem; var expectedCount = collection.Count + pair.Count; collection.InsertGroups(0, pair); Assert.Equal(expectedCount, collection.Count); }
public void CollectionChanged_Clear_NotifyResetEvent(ObservableKeyGroupsCollection <string, int> collection) { var catcher = CollectionHelper.CreateCollectionEventCatcher(collection); catcher.Subscribe(); collection.Clear(); Assert.True(catcher.IsExpectedEvent(NotifyCollectionChangedAction.Reset)); }
public void RemoveItems_EmptyListItems_CollectionNotChanged(ObservableKeyGroupsCollection <string, int> collection) { var size = collection.Select(x => (x.Key, x.Count())); collection.RemoveItems(CollectionHelper.CreateEmptyItemsList(), x => x.SelectKey(), x => x.SelectValue()); foreach (var item in collection) { Assert.True(item.Count() == size.FirstOrDefault(x => x.Key == item.Key).Item2); } }
public void ItemsChanged_Clear_NotifyOneTime(ObservableKeyGroupsCollection <string, int> collection) { var catcher = CollectionHelper.CreateItemsEventCatcher(collection); catcher.Subscribe(); collection.Clear(); catcher.Unsubscribe(); Assert.Equal(1, catcher.EventCount); }
public void ItemChanged_RemoveGroupsExistKeys_NotifyOneTime(ObservableKeyGroupsCollection <string, int> collection) { var catcher = CollectionHelper.CreateItemsEventCatcher(collection); catcher.Subscribe(); collection.RemoveGroups(CollectionHelper.KeysTwoFill); catcher.Unsubscribe(); Assert.Equal(1, catcher.EventCount); }