Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Reformat to fit in < 120 chars

  • Loading branch information...
commit 21367763c09104c460f527595a7895aa3d1d0653 1 parent a5aa5cc
@niik niik authored paulcbetts committed
View
29 ReactiveUI.Tests/ReactiveCollectionTest.cs
@@ -431,7 +431,8 @@ public class DerivedCollectionTestContainer
Func<TSource, bool> filter = null,
IComparer<TValue> orderer = null)
{
- var derived = source.CreateDerivedCollection(selector, filter, orderer == null ? (Func<TValue, TValue, int>)null : orderer.Compare);
+ var comparison = orderer == null ? (Func<TValue, TValue, int>)null : orderer.Compare;
+ var derived = source.CreateDerivedCollection(selector, filter, comparison);
return new DerivedCollectionTestContainer<TSource, TValue>
{
@@ -569,10 +570,23 @@ public void FilteredDerivedCollectionsShouldReactToPropertyChanges()
ChangeTrackingEnabled = true
};
- var onlyVisible = items.CreateDerivedCollection(x => x.Value, x => x.IsVisible, StringComparer.Ordinal.Compare);
- var onlyNonVisible = items.CreateDerivedCollection(x => x.Value, x => !x.IsVisible, StringComparer.Ordinal.Compare);
+ var onlyVisible = items.CreateDerivedCollection(
+ x => x.Value,
+ x => x.IsVisible,
+ StringComparer.Ordinal.Compare
+ );
+
+ var onlyNonVisible = items.CreateDerivedCollection(
+ x => x.Value,
+ x => !x.IsVisible,
+ StringComparer.Ordinal.Compare
+ );
- var onlVisibleStartingWithB = items.CreateDerivedCollection(x => x.Value, x => x.IsVisible && x.Value.StartsWith("b"), StringComparer.Ordinal.Compare);
+ var onlVisibleStartingWithB = items.CreateDerivedCollection(
+ x => x.Value,
+ x => x.IsVisible && x.Value.StartsWith("b"),
+ StringComparer.Ordinal.Compare
+ );
Assert.Equal(3, onlyVisible.Count);
Assert.Equal(0, onlyNonVisible.Count);
@@ -735,7 +749,12 @@ public void DerivedCollectionShouldOrderCorrectly()
public void DerivedCollectionShouldStopFollowingAfterDisposal()
{
var collection = new ReactiveCollection<int>();
- var orderedCollection = collection.CreateDerivedCollection(x => x.ToString(), null, (x, y) => x.CompareTo(y));
+
+ var orderedCollection = collection.CreateDerivedCollection(
+ x => x.ToString(),
+ null,
+ (x, y) => x.CompareTo(y)
+ );
collection.Add(1);
collection.Add(2);
View
4 ReactiveUI/ReactiveCollectionMixins.cs
@@ -245,8 +245,8 @@ private void onItemChanged(TSource changedItem)
if (orderer == null) {
// We don't have an orderer so we're currently using the source collection index for sorting
// meaning that no item change will affect ordering. Look at our current item and see if it's
- // the exact (reference-wise) same object. If it is then we're done, if it's not (for example if
- // it's an integer) we'll issue a replace event so that subscribers get the new value.
+ // the exact (reference-wise) same object. If it is then we're done, if it's not (for example
+ // if it's an integer) we'll issue a replace event so that subscribers get the new value.
if (!object.ReferenceEquals(newItem, this[destinationIndex])) {
internalReplace(destinationIndex, newItem);
}
Please sign in to comment.
Something went wrong with that request. Please try again.