diff --git a/Ix.NET/Integration/Android/Resources/Resource.Designer.cs b/Ix.NET/Integration/Android/Resources/Resource.Designer.cs
index c2fdf78530..42e0faa43e 100644
--- a/Ix.NET/Integration/Android/Resources/Resource.Designer.cs
+++ b/Ix.NET/Integration/Android/Resources/Resource.Designer.cs
@@ -14,7 +14,7 @@ namespace Android
{
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "1.0.0.0")]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "13.2.2.120")]
public partial class Resource
{
diff --git a/Rx.NET/Integration/Installation/Android/Resources/Resource.Designer.cs b/Rx.NET/Integration/Installation/Android/Resources/Resource.Designer.cs
index c2fdf78530..42e0faa43e 100644
--- a/Rx.NET/Integration/Installation/Android/Resources/Resource.Designer.cs
+++ b/Rx.NET/Integration/Installation/Android/Resources/Resource.Designer.cs
@@ -14,7 +14,7 @@ namespace Android
{
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "1.0.0.0")]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "13.2.2.120")]
public partial class Resource
{
diff --git a/Rx.NET/Source/src/Microsoft.Reactive.Testing/Microsoft.Reactive.Testing.csproj b/Rx.NET/Source/src/Microsoft.Reactive.Testing/Microsoft.Reactive.Testing.csproj
index 9621087694..d2961a43c1 100644
--- a/Rx.NET/Source/src/Microsoft.Reactive.Testing/Microsoft.Reactive.Testing.csproj
+++ b/Rx.NET/Source/src/Microsoft.Reactive.Testing/Microsoft.Reactive.Testing.csproj
@@ -9,7 +9,7 @@
Reactive Extensions (Rx) for .NET - Testing Library
readme.md
- $(NoWarn);IDE0054;IDE0066;CA1305;CA1307;CA1032;CA1064;CA1704;CA1822;CA1812;CA1820;CA1823;CA1825;CA1845;CA2249;IDE0016;IDE0018;IDE0019;IDE0020;IDE0031;IDE0039;IDE0044;IDE0059;IDE0074;IDE0270
+ $(NoWarn);IDE0054;IDE0066;CA1305;CA1307;CA1032;CA1064;CA1704;CA1822;CA1812;CA1820;CA1823;CA1825;CA1845;CA2249;IDE0016;IDE0018;IDE0019;IDE0020;IDE0028;IDE0031;IDE0039;IDE0044;IDE0059;IDE0074;IDE0090;IDE0270;IDE0300
diff --git a/Rx.NET/Source/src/System.Reactive/Internal/Lookup.cs b/Rx.NET/Source/src/System.Reactive/Internal/Lookup.cs
index d34a84d47d..2e9ae67c5e 100644
--- a/Rx.NET/Source/src/System.Reactive/Internal/Lookup.cs
+++ b/Rx.NET/Source/src/System.Reactive/Internal/Lookup.cs
@@ -39,7 +39,7 @@ public IEnumerable this[K key]
{
if (!_dictionary.TryGetValue(key, out var list))
{
- return Enumerable.Empty();
+ return [];
}
return Hide(list);
diff --git a/Rx.NET/Source/src/System.Reactive/Linq/Observable/Buffer.cs b/Rx.NET/Source/src/System.Reactive/Linq/Observable/Buffer.cs
index 2c484e18fc..1593c4c8fe 100644
--- a/Rx.NET/Source/src/System.Reactive/Linq/Observable/Buffer.cs
+++ b/Rx.NET/Source/src/System.Reactive/Linq/Observable/Buffer.cs
@@ -29,7 +29,7 @@ internal sealed class ExactSink : Sink>
{
private readonly int _count;
private int _index;
- private IList? _buffer;
+ private List? _buffer;
internal ExactSink(IObserver> observer, int count) : base(observer)
{
@@ -41,7 +41,7 @@ public override void OnNext(TSource value)
var buffer = _buffer;
if (buffer == null)
{
- buffer = new List();
+ buffer = [];
_buffer = buffer;
}
@@ -102,7 +102,7 @@ internal sealed class SkipSink : Sink>
private readonly int _count;
private readonly int _skip;
private int _index;
- private IList? _buffer;
+ private List? _buffer;
internal SkipSink(IObserver> observer, int count, int skip) : base(observer)
{
@@ -116,7 +116,7 @@ public override void OnNext(TSource value)
var buffer = _buffer;
if (idx == 0)
{
- buffer = new List();
+ buffer = [];
_buffer = buffer;
}
diff --git a/Rx.NET/Source/src/System.Reactive/Linq/Observable/FromEventPattern.cs b/Rx.NET/Source/src/System.Reactive/Linq/Observable/FromEventPattern.cs
index 7160319697..3cac9d4a1f 100644
--- a/Rx.NET/Source/src/System.Reactive/Linq/Observable/FromEventPattern.cs
+++ b/Rx.NET/Source/src/System.Reactive/Linq/Observable/FromEventPattern.cs
@@ -135,13 +135,13 @@ public void Dispose()
private Action AddHandlerCore(Delegate handler)
{
- _addMethod.Invoke(_target, new object[] { handler });
- return () => _removeMethod.Invoke(_target, new object[] { handler });
+ _addMethod.Invoke(_target, [handler]);
+ return () => _removeMethod.Invoke(_target, [handler]);
}
private Action AddHandlerCoreWinRT(Delegate handler)
{
- var token = _addMethod.Invoke(_target, new object[] { handler });
+ var token = _addMethod.Invoke(_target, [handler]);
return () => _removeMethod.Invoke(_target, [token]);
}
}
diff --git a/Rx.NET/Source/src/System.Reactive/Linq/QueryLanguage.Blocking.cs b/Rx.NET/Source/src/System.Reactive/Linq/QueryLanguage.Blocking.cs
index e0e31c3319..2724f19d4d 100644
--- a/Rx.NET/Source/src/System.Reactive/Linq/QueryLanguage.Blocking.cs
+++ b/Rx.NET/Source/src/System.Reactive/Linq/QueryLanguage.Blocking.cs
@@ -16,7 +16,7 @@ internal partial class QueryLanguage
public virtual IEnumerable> Chunkify(IObservable source)
{
- return source.Collect>(() => new List(), (lst, x) => { lst.Add(x); return lst; }, _ => new List());
+ return source.Collect>(() => [], (lst, x) => { lst.Add(x); return lst; }, _ => []);
}
#endregion
diff --git a/Rx.NET/Source/src/System.Reactive/ObservableQuery.cs b/Rx.NET/Source/src/System.Reactive/ObservableQuery.cs
index abe1629a56..452a9b5553 100644
--- a/Rx.NET/Source/src/System.Reactive/ObservableQuery.cs
+++ b/Rx.NET/Source/src/System.Reactive/ObservableQuery.cs
@@ -322,13 +322,13 @@ private IList VisitQbservableOperatorArguments(MethodInfo method, IE
if (lastArgument.NodeType == ExpressionType.NewArrayInit)
{
var paramsArray = (NewArrayExpression)lastArgument;
- return new List
- {
+ return
+ [
Expression.NewArrayInit(
typeof(Plan<>).MakeGenericType(method.GetGenericArguments()[0]),
paramsArray.Expressions.Select(param => Visit(param))
)
- };
+ ];
}
}
diff --git a/Rx.NET/Source/src/System.Reactive/Subjects/AsyncSubject.cs b/Rx.NET/Source/src/System.Reactive/Subjects/AsyncSubject.cs
index 4cca1fc1c8..ee454c194e 100644
--- a/Rx.NET/Source/src/System.Reactive/Subjects/AsyncSubject.cs
+++ b/Rx.NET/Source/src/System.Reactive/Subjects/AsyncSubject.cs
@@ -22,7 +22,7 @@ public sealed class AsyncSubject : SubjectBase, INotifyCompletion
private bool _hasValue;
private Exception? _exception;
-#pragma warning disable CA1825 // (Avoid zero-length array allocations.) The identity of these arrays matters, so we can't use the shared Array.Empty() instance
+#pragma warning disable CA1825,IDE0300 // (Avoid zero-length array allocations. Use collection expressions) The identity of these arrays matters, so we can't use the shared Array.Empty() instance either explicitly, or indirectly via a collection expression
///
/// A pre-allocated empty array indicating the AsyncSubject has terminated.
///
@@ -31,7 +31,7 @@ public sealed class AsyncSubject : SubjectBase, INotifyCompletion
/// A pre-allocated empty array indicating the AsyncSubject has been disposed.
///
private static readonly AsyncSubjectDisposable[] Disposed = new AsyncSubjectDisposable[0];
-#pragma warning restore CA1825
+#pragma warning restore CA1825,IDE0300
#endregion
diff --git a/Rx.NET/Source/src/System.Reactive/Subjects/Subject.cs b/Rx.NET/Source/src/System.Reactive/Subjects/Subject.cs
index 263527254b..8b1c3ca043 100644
--- a/Rx.NET/Source/src/System.Reactive/Subjects/Subject.cs
+++ b/Rx.NET/Source/src/System.Reactive/Subjects/Subject.cs
@@ -18,10 +18,10 @@ public sealed class Subject : SubjectBase
private SubjectDisposable[] _observers;
private Exception? _exception;
-#pragma warning disable CA1825 // (Avoid zero-length array allocations.) The identity of these arrays matters, so we can't use the shared Array.Empty() instance
+#pragma warning disable CA1825,IDE0300 // (Avoid zero-length array allocations. Use collection expressions) The identity of these arrays matters, so we can't use the shared Array.Empty() instance either explicitly, or indirectly via a collection expression
private static readonly SubjectDisposable[] Terminated = new SubjectDisposable[0];
private static readonly SubjectDisposable[] Disposed = new SubjectDisposable[0];
-#pragma warning restore CA1825
+#pragma warning restore CA1825,IDE0300
#endregion
diff --git a/Rx.NET/Source/tests/Tests.System.Reactive.ApiApprovals/Api/ApiApprovalTests.cs b/Rx.NET/Source/tests/Tests.System.Reactive.ApiApprovals/Api/ApiApprovalTests.cs
index e9b49fe342..bee67977ab 100644
--- a/Rx.NET/Source/tests/Tests.System.Reactive.ApiApprovals/Api/ApiApprovalTests.cs
+++ b/Rx.NET/Source/tests/Tests.System.Reactive.ApiApprovals/Api/ApiApprovalTests.cs
@@ -50,7 +50,7 @@ private string GeneratePublicApi(Assembly assembly)
{
ApiGeneratorOptions options = new()
{
- AllowNamespacePrefixes = new[] { "System", "Microsoft" }
+ AllowNamespacePrefixes = ["System", "Microsoft"]
};
return Filter(ApiGenerator.GeneratePublicApi(assembly, options));
}
diff --git a/Rx.NET/Source/tests/Tests.System.Reactive/Tests/Aliases.cs b/Rx.NET/Source/tests/Tests.System.Reactive/Tests/Aliases.cs
index 0d7ee5285c..a1681a9a74 100644
--- a/Rx.NET/Source/tests/Tests.System.Reactive/Tests/Aliases.cs
+++ b/Rx.NET/Source/tests/Tests.System.Reactive/Tests/Aliases.cs
@@ -21,10 +21,10 @@ public void Qbservable_Aliases()
{
var xs = Observable.Return(1).AsQbservable();
- Assert.True(xs.Filter(x => true).ToEnumerable().SequenceEqual(new[] { 1 }), "Filter");
- Assert.True(xs.Filter(x => true).Concat(xs.Filter(x => false)).ToEnumerable().SequenceEqual(new[] { 1 }), "Concat/Filter");
- Assert.True(xs.Map(x => x.ToString()).ToEnumerable().SequenceEqual(new[] { "1" }), "Map");
- Assert.True(xs.FlatMap(x => xs).ToEnumerable().SequenceEqual(new[] { 1 }), "FlatMap");
+ Assert.True(xs.Filter(x => true).ToEnumerable().SequenceEqual([1]), "Filter");
+ Assert.True(xs.Filter(x => true).Concat(xs.Filter(x => false)).ToEnumerable().SequenceEqual([1]), "Concat/Filter");
+ Assert.True(xs.Map(x => x.ToString()).ToEnumerable().SequenceEqual(["1"]), "Map");
+ Assert.True(xs.FlatMap(x => xs).ToEnumerable().SequenceEqual([1]), "FlatMap");
}
}
}
diff --git a/Rx.NET/Source/tests/Tests.System.Reactive/Tests/ArgumentValidationTest.cs b/Rx.NET/Source/tests/Tests.System.Reactive/Tests/ArgumentValidationTest.cs
index 0595a01e82..7e5ff919da 100644
--- a/Rx.NET/Source/tests/Tests.System.Reactive/Tests/ArgumentValidationTest.cs
+++ b/Rx.NET/Source/tests/Tests.System.Reactive/Tests/ArgumentValidationTest.cs
@@ -40,6 +40,7 @@ public class ArgumentValidationTest
///
static ArgumentValidationTest()
{
+#pragma warning disable IDE0300 // Simplify collection initialization. We want to be clear about what kinds of collections are in use in these tests.
_defaultValues = new Dictionary
{
{ "IObservable`1[Object]", Observable.Return(new object()) },
@@ -269,6 +270,7 @@ static ArgumentValidationTest()
{ "Func`17[Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, AsyncCallback, Object, IAsyncResult]", new Func((v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16) => null) }
};
+#pragma warning restore IDE0300 // Simplify collection initialization
}
#endregion
diff --git a/Rx.NET/Source/tests/Tests.System.Reactive/Tests/Concurrency/SchedulerTest.cs b/Rx.NET/Source/tests/Tests.System.Reactive/Tests/Concurrency/SchedulerTest.cs
index 008d3c1f8f..45b6b7f809 100644
--- a/Rx.NET/Source/tests/Tests.System.Reactive/Tests/Concurrency/SchedulerTest.cs
+++ b/Rx.NET/Source/tests/Tests.System.Reactive/Tests/Concurrency/SchedulerTest.cs
@@ -479,7 +479,7 @@ public void OnResuming()
public void DisableOptimizations_ArgumentChecking()
{
ReactiveAssert.Throws(() => Scheduler.DisableOptimizations(default));
- ReactiveAssert.Throws(() => Scheduler.DisableOptimizations(default, new Type[0]));
+ ReactiveAssert.Throws(() => Scheduler.DisableOptimizations(default, []));
#if !WINDOWS
ReactiveAssert.Throws(() => Scheduler.DisableOptimizations(ThreadPoolScheduler.Instance, default));
#endif
diff --git a/Rx.NET/Source/tests/Tests.System.Reactive/Tests/Disposables/DisposableTests.cs b/Rx.NET/Source/tests/Tests.System.Reactive/Tests/Disposables/DisposableTests.cs
index b0a166bd13..2c6bee05dd 100644
--- a/Rx.NET/Source/tests/Tests.System.Reactive/Tests/Disposables/DisposableTests.cs
+++ b/Rx.NET/Source/tests/Tests.System.Reactive/Tests/Disposables/DisposableTests.cs
@@ -196,7 +196,7 @@ public void CompositeDisposable_ToArray()
var g = new CompositeDisposable(d1, d2);
Assert.Equal(2, g.Count);
var x = Enumerable.ToArray(g);
- Assert.True(g.ToArray().SequenceEqual(new[] { d1, d2 }));
+ Assert.True(g.ToArray().SequenceEqual([d1, d2]));
}
[TestMethod]
@@ -211,7 +211,7 @@ public void CompositeDisposable_GetEnumerator()
lst.Add(x);
}
- Assert.True(lst.SequenceEqual(new[] { d1, d2 }));
+ Assert.True(lst.SequenceEqual([d1, d2]));
}
[TestMethod]
@@ -226,7 +226,7 @@ public void CompositeDisposable_GetEnumeratorNonGeneric()
lst.Add(x);
}
- Assert.True(lst.SequenceEqual(new[] { d1, d2 }));
+ Assert.True(lst.SequenceEqual([d1, d2]));
}
[TestMethod]
@@ -252,7 +252,7 @@ public void CompositeDisposable_AddNull_via_params_ctor()
[TestMethod]
public void CompositeDisposable_AddNull_via_IEnum_ctor()
{
- IEnumerable values = new IDisposable[] { null };
+ IEnumerable values = [null];
#pragma warning disable CA1806 // (Unused new instance.) We expect the constructor to throw.
ReactiveAssert.Throws(() => new CompositeDisposable(values));
#pragma warning restore CA1806
@@ -882,7 +882,7 @@ public void StableCompositeDisposable_Nary2()
var disp3 = false;
var d3 = Disposable.Create(() => { Assert.False(disp3); disp3 = true; });
- var d = StableCompositeDisposable.Create(new List(new[] { d1, d2, d3 }));
+ var d = StableCompositeDisposable.Create(new List([d1, d2, d3]));
Assert.False(disp1);
Assert.False(disp2);
diff --git a/Rx.NET/Source/tests/Tests.System.Reactive/Tests/ImmutableListTest.cs b/Rx.NET/Source/tests/Tests.System.Reactive/Tests/ImmutableListTest.cs
index 9c4521ff2a..67f3ecea4c 100644
--- a/Rx.NET/Source/tests/Tests.System.Reactive/Tests/ImmutableListTest.cs
+++ b/Rx.NET/Source/tests/Tests.System.Reactive/Tests/ImmutableListTest.cs
@@ -21,37 +21,37 @@ public void ImmutableList_Basics()
{
var list = ImmutableList.Empty;
- Assert.True(list.Data.SequenceEqual(new int[] { }));
+ Assert.True(list.Data.SequenceEqual([]));
list = list.Add(42);
- Assert.True(list.Data.SequenceEqual(new int[] { 42 }));
+ Assert.True(list.Data.SequenceEqual([42]));
list = list.Remove(42);
- Assert.True(list.Data.SequenceEqual(new int[] { }));
+ Assert.True(list.Data.SequenceEqual([]));
list = list.Remove(42);
- Assert.True(list.Data.SequenceEqual(new int[] { }));
+ Assert.True(list.Data.SequenceEqual([]));
list = list.Add(43);
list = list.Add(44);
list = list.Add(43);
- Assert.True(list.Data.SequenceEqual(new int[] { 43, 44, 43 }));
+ Assert.True(list.Data.SequenceEqual([43, 44, 43]));
list = list.Remove(43);
- Assert.True(list.Data.SequenceEqual(new int[] { 44, 43 }));
+ Assert.True(list.Data.SequenceEqual([44, 43]));
list = list.Remove(43);
- Assert.True(list.Data.SequenceEqual(new int[] { 44 }));
+ Assert.True(list.Data.SequenceEqual([44]));
list = list.Remove(44);
- Assert.True(list.Data.SequenceEqual(new int[] { }));
+ Assert.True(list.Data.SequenceEqual([]));
}
[TestMethod]
@@ -59,15 +59,15 @@ public void ImmutableList_Nulls()
{
var list = ImmutableList.Empty;
- Assert.True(list.Data.SequenceEqual(new string[] { }));
+ Assert.True(list.Data.SequenceEqual([]));
list = list.Add(null);
- Assert.True(list.Data.SequenceEqual(new string[] { null }));
+ Assert.True(list.Data.SequenceEqual([null]));
list = list.Remove(null);
- Assert.True(list.Data.SequenceEqual(new string[] { }));
+ Assert.True(list.Data.SequenceEqual([]));
}
}
#endif
diff --git a/Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/Observable/AutoConnectTest.cs b/Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/Observable/AutoConnectTest.cs
index daab682f74..a497608740 100644
--- a/Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/Observable/AutoConnectTest.cs
+++ b/Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/Observable/AutoConnectTest.cs
@@ -12,6 +12,8 @@
using Assert = Xunit.Assert;
+#pragma warning disable IDE0028 // Simplify collection initialization. Using this in Assert.Equals makes it unclear what types are actually in use.
+
namespace ReactiveTests.Tests
{
[TestClass]
diff --git a/Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/Observable/BufferTest.cs b/Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/Observable/BufferTest.cs
index 142882136b..f77c248ea4 100644
--- a/Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/Observable/BufferTest.cs
+++ b/Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/Observable/BufferTest.cs
@@ -56,9 +56,9 @@ public void Buffer_Closings_Basic()
);
res.Messages.AssertEqual(
- OnNext>(300, b => b.SequenceEqual(new int[] { 3, 4 })),
- OnNext>(500, b => b.SequenceEqual(new int[] { 5, 6, 7, 8, 9 })),
- OnNext>(590, b => b.SequenceEqual(new int[] { 10 })),
+ OnNext>(300, b => b.SequenceEqual([3, 4])),
+ OnNext>(500, b => b.SequenceEqual([5, 6, 7, 8, 9])),
+ OnNext>(590, b => b.SequenceEqual([10])),
OnCompleted>(590)
);
@@ -112,10 +112,10 @@ public void Buffer_Closings_InnerSubscriptions()
);
res.Messages.AssertEqual(
- OnNext>(300, b => b.SequenceEqual(new int[] { 3, 4 })),
- OnNext>(400, b => b.SequenceEqual(new int[] { 5, 6 })),
- OnNext>(500, b => b.SequenceEqual(new int[] { 7, 8, 9 })),
- OnNext>(590, b => b.SequenceEqual(new int[] { 10 })),
+ OnNext>(300, b => b.SequenceEqual([3, 4])),
+ OnNext>(400, b => b.SequenceEqual([5, 6])),
+ OnNext>(500, b => b.SequenceEqual([7, 8, 9])),
+ OnNext>(590, b => b.SequenceEqual([10])),
OnCompleted>(590)
);
@@ -166,9 +166,9 @@ public void Buffer_Closings_Empty()
);
res.Messages.AssertEqual(
- OnNext>(300, l => l.SequenceEqual(new int[] { 3, 4 })),
- OnNext>(500, l => l.SequenceEqual(new int[] { 5, 6, 7, 8, 9 })),
- OnNext>(590, l => l.SequenceEqual(new int[] { 10 })),
+ OnNext>(300, l => l.SequenceEqual([3, 4])),
+ OnNext>(500, l => l.SequenceEqual([5, 6, 7, 8, 9])),
+ OnNext>(590, l => l.SequenceEqual([10])),
OnCompleted>(590)
);
@@ -205,7 +205,7 @@ public void Buffer_Closings_Dispose()
);
res.Messages.AssertEqual(
- OnNext>(300, l => l.SequenceEqual(new int[] { 3, 4 }))
+ OnNext>(300, l => l.SequenceEqual([3, 4]))
);
xs.Subscriptions.AssertEqual(
@@ -241,8 +241,8 @@ public void Buffer_Closings_Error()
);
res.Messages.AssertEqual(
- OnNext>(300, l => l.SequenceEqual(new int[] { 3, 4 })),
- OnNext>(500, l => l.SequenceEqual(new int[] { 5, 6, 7, 8, 9 })),
+ OnNext>(300, l => l.SequenceEqual([3, 4])),
+ OnNext>(500, l => l.SequenceEqual([5, 6, 7, 8, 9])),
OnError>(590, ex)
);
@@ -351,10 +351,10 @@ public void Buffer_OpeningClosings_Basic()
);
res.Messages.AssertEqual(
- OnNext>(305, b => b.SequenceEqual(new int[] { 4 })),
- OnNext>(400, b => b.SequenceEqual(new int[] { })),
- OnNext>(430, b => b.SequenceEqual(new int[] { 6, 7, 8 })),
- OnNext>(490, b => b.SequenceEqual(new int[] { 7, 8, 9 })),
+ OnNext>(305, b => b.SequenceEqual([4])),
+ OnNext>(400, b => b.SequenceEqual([])),
+ OnNext>(430, b => b.SequenceEqual([6, 7, 8])),
+ OnNext>(490, b => b.SequenceEqual([7, 8, 9])),
OnCompleted>(900)
);
@@ -406,12 +406,12 @@ public void Buffer_Boundaries_Simple()
);
res.Messages.AssertEqual(
- OnNext>(255, b => b.SequenceEqual(new int[] { 3 })),
- OnNext>(330, b => b.SequenceEqual(new int[] { 4, 5 })),
- OnNext>(350, b => b.SequenceEqual(new int[] { 6 })),
- OnNext>(400, b => b.SequenceEqual(new int[] { })),
- OnNext>(500, b => b.SequenceEqual(new int[] { 7, 8, 9 })),
- OnNext>(590, b => b.SequenceEqual(new int[] { 10 })),
+ OnNext>(255, b => b.SequenceEqual([3])),
+ OnNext>(330, b => b.SequenceEqual([4, 5])),
+ OnNext>(350, b => b.SequenceEqual([6])),
+ OnNext>(400, b => b.SequenceEqual([])),
+ OnNext>(500, b => b.SequenceEqual([7, 8, 9])),
+ OnNext>(590, b => b.SequenceEqual([10])),
OnCompleted>(590)
);
@@ -455,10 +455,10 @@ public void Buffer_Boundaries_OnCompletedBoundaries()
);
res.Messages.AssertEqual(
- OnNext>(255, b => b.SequenceEqual(new int[] { 3 })),
- OnNext>(330, b => b.SequenceEqual(new int[] { 4, 5 })),
- OnNext>(350, b => b.SequenceEqual(new int[] { 6 })),
- OnNext>(400, b => b.SequenceEqual(new int[] { })),
+ OnNext>(255, b => b.SequenceEqual([3])),
+ OnNext>(330, b => b.SequenceEqual([4, 5])),
+ OnNext>(350, b => b.SequenceEqual([6])),
+ OnNext>(400, b => b.SequenceEqual([])),
OnCompleted>(400)
);
@@ -501,9 +501,9 @@ public void Buffer_Boundaries_OnErrorSource()
);
res.Messages.AssertEqual(
- OnNext>(255, b => b.SequenceEqual(new int[] { 3 })),
- OnNext>(330, b => b.SequenceEqual(new int[] { 4, 5 })),
- OnNext>(350, b => b.SequenceEqual(new int[] { 6 })),
+ OnNext>(255, b => b.SequenceEqual([3])),
+ OnNext>(330, b => b.SequenceEqual([4, 5])),
+ OnNext>(350, b => b.SequenceEqual([6])),
OnError>(400, ex)
);
@@ -549,9 +549,9 @@ public void Buffer_Boundaries_OnErrorBoundaries()
);
res.Messages.AssertEqual(
- OnNext>(255, b => b.SequenceEqual(new int[] { 3 })),
- OnNext>(330, b => b.SequenceEqual(new int[] { 4, 5 })),
- OnNext>(350, b => b.SequenceEqual(new int[] { 6 })),
+ OnNext>(255, b => b.SequenceEqual([3])),
+ OnNext>(330, b => b.SequenceEqual([4, 5])),
+ OnNext>(350, b => b.SequenceEqual([6])),
OnError>(400, ex)
);
@@ -600,7 +600,7 @@ public void Buffer_Count_PartialWindow()
);
res.Messages.AssertEqual(
- OnNext>(250, l => l.SequenceEqual(new[] { 2, 3, 4, 5 })),
+ OnNext>(250, l => l.SequenceEqual([2, 3, 4, 5])),
OnCompleted>(250)
);
@@ -628,8 +628,8 @@ public void Buffer_Count_FullWindows()
);
res.Messages.AssertEqual(
- OnNext>(220, l => l.SequenceEqual(new[] { 2, 3 })),
- OnNext>(240, l => l.SequenceEqual(new[] { 4, 5 })),
+ OnNext>(220, l => l.SequenceEqual([2, 3])),
+ OnNext>(240, l => l.SequenceEqual([4, 5])),
OnCompleted>(250)
);
@@ -657,8 +657,8 @@ public void Buffer_Count_FullAndPartialWindows()
);
res.Messages.AssertEqual(
- OnNext>(230, l => l.SequenceEqual(new int[] { 2, 3, 4 })),
- OnNext>(250, l => l.SequenceEqual(new int[] { 5 })),
+ OnNext>(230, l => l.SequenceEqual([2, 3, 4])),
+ OnNext>(250, l => l.SequenceEqual([5])),
OnCompleted>(250)
);
@@ -715,10 +715,10 @@ public void Buffer_Count_Skip_Less()
);
res.Messages.AssertEqual(
- OnNext>(230, l => l.SequenceEqual(new int[] { 2, 3, 4 })),
- OnNext>(240, l => l.SequenceEqual(new int[] { 3, 4, 5 })),
- OnNext>(250, l => l.SequenceEqual(new int[] { 4, 5 })),
- OnNext>(250, l => l.SequenceEqual(new int[] { 5 })),
+ OnNext>(230, l => l.SequenceEqual([2, 3, 4])),
+ OnNext>(240, l => l.SequenceEqual([3, 4, 5])),
+ OnNext>(250, l => l.SequenceEqual([4, 5])),
+ OnNext>(250, l => l.SequenceEqual([5])),
OnCompleted>(250)
);
@@ -746,8 +746,8 @@ public void Buffer_Count_Skip_More()
);
res.Messages.AssertEqual(
- OnNext>(220, l => l.SequenceEqual(new int[] { 2, 3 })),
- OnNext>(250, l => l.SequenceEqual(new int[] { 5 })),
+ OnNext>(220, l => l.SequenceEqual([2, 3])),
+ OnNext>(250, l => l.SequenceEqual([5])),
OnCompleted>(250)
);
diff --git a/Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/Observable/CatchTest.cs b/Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/Observable/CatchTest.cs
index f0ba464146..9fbca8c084 100644
--- a/Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/Observable/CatchTest.cs
+++ b/Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/Observable/CatchTest.cs
@@ -15,6 +15,8 @@
using Assert = Xunit.Assert;
+#pragma warning disable IDE0300 // Simplify collection initialization. We want to be clear about what kinds of collections are in use in these tests.
+
namespace ReactiveTests.Tests
{
[TestClass]
@@ -712,7 +714,7 @@ public void Catch_DefaultScheduler_NaryEnumerable()
{
var evt = new ManualResetEvent(false);
- IEnumerable> sources = new[] { Observable.Return(1), Observable.Return(2), Observable.Return(3) };
+ IEnumerable> sources = [Observable.Return(1), Observable.Return(2), Observable.Return(3)];
var res = 0;
Observable.Catch(sources).Subscribe(x =>
@@ -837,7 +839,7 @@ public void Catch_EnumerableTiming()
OnCompleted(340)
);
- var xss = new MockEnumerable>(scheduler, new[] { o1, o2, o3, o2 });
+ var xss = new MockEnumerable>(scheduler, [o1, o2, o3, o2]);
var res = scheduler.Start(() =>
xss.Select(xs => (IObservable)xs).Catch()
@@ -894,7 +896,7 @@ public void Catch_Enumerable_Dispose()
OnCompleted(340)
);
- var xss = new MockEnumerable>(scheduler, new[] { o1, o2 });
+ var xss = new MockEnumerable>(scheduler, [o1, o2]);
var res = scheduler.Start(() =>
xss.Select(xs => (IObservable)xs).Catch(),
diff --git a/Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/Observable/ChunkifyTest.cs b/Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/Observable/ChunkifyTest.cs
index c0cb483878..fa9f8e6884 100644
--- a/Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/Observable/ChunkifyTest.cs
+++ b/Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/Observable/ChunkifyTest.cs
@@ -69,13 +69,13 @@ public void Chunkify_Regular1()
);
Assert.Equal(7, res.Count);
- Assert.True(res[0].SequenceEqual(new int[] { }));
- Assert.True(res[1].SequenceEqual(new int[] { 3 }));
- Assert.True(res[2].SequenceEqual(new int[] { 4 }));
- Assert.True(res[3].SequenceEqual(new int[] { }));
- Assert.True(res[4].SequenceEqual(new int[] { 5, 6, 7 }));
- Assert.True(res[5].SequenceEqual(new int[] { 8 }));
- Assert.True(res[6].SequenceEqual(new int[] { }));
+ Assert.True(res[0].SequenceEqual([]));
+ Assert.True(res[1].SequenceEqual([3]));
+ Assert.True(res[2].SequenceEqual([4]));
+ Assert.True(res[3].SequenceEqual([]));
+ Assert.True(res[4].SequenceEqual([5, 6, 7]));
+ Assert.True(res[5].SequenceEqual([8]));
+ Assert.True(res[6].SequenceEqual([]));
}
[TestMethod]
@@ -118,8 +118,8 @@ public void Chunkify_Regular2()
);
Assert.Equal(2, res.Count);
- Assert.True(res[0].SequenceEqual(new int[] { 3, 4, 5 }));
- Assert.True(res[1].SequenceEqual(new int[] { 6, 7, 8 }));
+ Assert.True(res[0].SequenceEqual([3, 4, 5]));
+ Assert.True(res[1].SequenceEqual([6, 7, 8]));
}
[TestMethod]
@@ -175,10 +175,10 @@ public void Chunkify_Error()
);
Assert.Equal(4, res.Count);
- Assert.True(res[0].SequenceEqual(new int[] { }));
- Assert.True(res[1].SequenceEqual(new int[] { 3 }));
- Assert.True(res[2].SequenceEqual(new int[] { 4 }));
- Assert.True(res[3].SequenceEqual(new int[] { }));
+ Assert.True(res[0].SequenceEqual([]));
+ Assert.True(res[1].SequenceEqual([3]));
+ Assert.True(res[2].SequenceEqual([4]));
+ Assert.True(res[3].SequenceEqual([]));
}
}
diff --git a/Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/Observable/CombineLatestTest.cs b/Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/Observable/CombineLatestTest.cs
index 3897feaf70..a7fb98c05d 100644
--- a/Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/Observable/CombineLatestTest.cs
+++ b/Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/Observable/CombineLatestTest.cs
@@ -3707,10 +3707,10 @@ public void CombineLatest_List_Regular()
);
res.Messages.AssertEqual(
- OnNext>(230, l => l.SequenceEqual(new[] { 1, 2, 3 })),
- OnNext>(240, l => l.SequenceEqual(new[] { 4, 2, 3 })),
- OnNext>(250, l => l.SequenceEqual(new[] { 4, 5, 3 })),
- OnNext>(260, l => l.SequenceEqual(new[] { 4, 5, 6 })),
+ OnNext>(230, l => l.SequenceEqual([1, 2, 3])),
+ OnNext>(240, l => l.SequenceEqual([4, 2, 3])),
+ OnNext>(250, l => l.SequenceEqual([4, 5, 3])),
+ OnNext>(260, l => l.SequenceEqual([4, 5, 6])),
OnCompleted>(290)
);
}
@@ -3720,7 +3720,7 @@ public void CombineLatest_NAry_ArgumentChecking()
{
ReactiveAssert.Throws(() => Observable.CombineLatest(default(IEnumerable>)));
ReactiveAssert.Throws(() => Observable.CombineLatest(default(IEnumerable>), _ => 42));
- ReactiveAssert.Throws(() => Observable.CombineLatest(new[] { Observable.Return(42) }, default(Func, string>)));
+ ReactiveAssert.Throws(() => Observable.CombineLatest([Observable.Return(42)], default(Func, string>)));
ReactiveAssert.Throws(() => Observable.CombineLatest(default(IObservable[])));
}
@@ -3738,10 +3738,10 @@ public void CombineLatest_NAry_Symmetric()
);
res.Messages.AssertEqual(
- OnNext>(230, l => l.SequenceEqual(new[] { 1, 2, 3 })),
- OnNext>(240, l => l.SequenceEqual(new[] { 1, 5, 3 })),
- OnNext>(250, l => l.SequenceEqual(new[] { 4, 5, 3 })),
- OnNext>(260, l => l.SequenceEqual(new[] { 4, 5, 6 })),
+ OnNext>(230, l => l.SequenceEqual([1, 2, 3])),
+ OnNext>(240, l => l.SequenceEqual([1, 5, 3])),
+ OnNext>(250, l => l.SequenceEqual([4, 5, 3])),
+ OnNext>(260, l => l.SequenceEqual([4, 5, 6])),
OnCompleted>(420)
);
@@ -3806,13 +3806,13 @@ public void CombineLatest_NAry_Asymmetric()
);
res.Messages.AssertEqual(
- OnNext>(230, l => l.SequenceEqual(new[] { 1, 2, 3 })),
- OnNext>(240, l => l.SequenceEqual(new[] { 1, 5, 3 })),
- OnNext>(250, l => l.SequenceEqual(new[] { 4, 5, 3 })),
- OnNext>(260, l => l.SequenceEqual(new[] { 4, 5, 6 })),
- OnNext>(280, l => l.SequenceEqual(new[] { 4, 5, 8 })),
- OnNext>(290, l => l.SequenceEqual(new[] { 4, 7, 8 })),
- OnNext>(310, l => l.SequenceEqual(new[] { 4, 9, 8 })),
+ OnNext>(230, l => l.SequenceEqual([1, 2, 3])),
+ OnNext>(240, l => l.SequenceEqual([1, 5, 3])),
+ OnNext>(250, l => l.SequenceEqual([4, 5, 3])),
+ OnNext>(260, l => l.SequenceEqual([4, 5, 6])),
+ OnNext>(280, l => l.SequenceEqual([4, 5, 8])),
+ OnNext>(290, l => l.SequenceEqual([4, 7, 8])),
+ OnNext>(310, l => l.SequenceEqual([4, 9, 8])),
OnCompleted>(410)
);
@@ -3882,8 +3882,8 @@ public void CombineLatest_NAry_Error()
);
res.Messages.AssertEqual(
- OnNext>(230, l => l.SequenceEqual(new[] { 1, 2, 3 })),
- OnNext>(240, l => l.SequenceEqual(new[] { 1, 5, 3 })),
+ OnNext>(230, l => l.SequenceEqual([1, 2, 3])),
+ OnNext>(240, l => l.SequenceEqual([1, 5, 3])),
OnError>(250, ex)
);
diff --git a/Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/Observable/ConcatTest.cs b/Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/Observable/ConcatTest.cs
index f6c8e23e34..827d31777b 100644
--- a/Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/Observable/ConcatTest.cs
+++ b/Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/Observable/ConcatTest.cs
@@ -59,7 +59,7 @@ public void Concat_IEofIO_DefaultScheduler()
{
var evt = new ManualResetEvent(false);
- IEnumerable> sources = new[] { Observable.Return(1), Observable.Return(2), Observable.Return(3) };
+ IEnumerable> sources = [Observable.Return(1), Observable.Return(2), Observable.Return(3)];
var sum = 0;
Observable.Concat(sources).Subscribe(n =>
@@ -716,7 +716,7 @@ public void Concat_EnumerableTiming()
OnCompleted(340)
);
- var xss = new MockEnumerable>(scheduler, new[] { o1, o2, o3, o2 });
+ var xss = new MockEnumerable>(scheduler, [o1, o2, o3, o2]);
var res = scheduler.Start(() =>
xss.Select(xs => (IObservable)xs).Concat()
@@ -777,7 +777,7 @@ public void Concat_Enumerable_Dispose()
OnCompleted(340)
);
- var xss = new MockEnumerable>(scheduler, new[] { o1, o2 });
+ var xss = new MockEnumerable>(scheduler, [o1, o2]);
var res = scheduler.Start(() =>
xss.Select(xs => (IObservable)xs).Concat(),
@@ -940,7 +940,7 @@ public void Concat_Task()
var res = tss.ToArray().Single();
- Assert.True(res.SequenceEqual(new[] { 1, 2, 3 }));
+ Assert.True(res.SequenceEqual([1, 2, 3]));
}
}
diff --git a/Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/Observable/CreateAsyncTest.cs b/Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/Observable/CreateAsyncTest.cs
index b968674489..75ec127eb3 100644
--- a/Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/Observable/CreateAsyncTest.cs
+++ b/Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/Observable/CreateAsyncTest.cs
@@ -46,7 +46,7 @@ public void CreateAsync_NullCoalescingAction1()
var d = xs.Subscribe(lst.Add);
d.Dispose();
- Assert.True(lst.SequenceEqual(new[] { 42 }));
+ Assert.True(lst.SequenceEqual([42]));
}
[TestMethod]
@@ -62,7 +62,7 @@ public void CreateAsync_NullCoalescingAction2()
var d = xs.Subscribe(lst.Add);
d.Dispose();
- Assert.True(lst.SequenceEqual(new[] { 42 }));
+ Assert.True(lst.SequenceEqual([42]));
}
[TestMethod]
@@ -78,7 +78,7 @@ public void CreateAsync_NullCoalescingDisposable1()
var d = xs.Subscribe(lst.Add);
d.Dispose();
- Assert.True(lst.SequenceEqual(new[] { 42 }));
+ Assert.True(lst.SequenceEqual([42]));
}
[TestMethod]
@@ -94,7 +94,7 @@ public void CreateAsync_NullCoalescingDisposable2()
var d = xs.Subscribe(lst.Add);
d.Dispose();
- Assert.True(lst.SequenceEqual(new[] { 42 }));
+ Assert.True(lst.SequenceEqual([42]));
}
private Task Producer1(IObserver results, IScheduler scheduler, CancellationToken token)
diff --git a/Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/Observable/CreateTest.cs b/Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/Observable/CreateTest.cs
index aea66f64b2..4b69818f57 100644
--- a/Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/Observable/CreateTest.cs
+++ b/Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/Observable/CreateTest.cs
@@ -53,7 +53,7 @@ public void Create_NullCoalescingAction()
var d = xs.Subscribe(lst.Add);
d.Dispose();
- Assert.True(lst.SequenceEqual(new[] { 42 }));
+ Assert.True(lst.SequenceEqual([42]));
}
[TestMethod]
@@ -228,7 +228,7 @@ public void CreateWithDisposable_NullCoalescingAction()
var d = xs.Subscribe(lst.Add);
d.Dispose();
- Assert.True(lst.SequenceEqual(new[] { 42 }));
+ Assert.True(lst.SequenceEqual([42]));
}
[TestMethod]
diff --git a/Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/Observable/DelayTest.cs b/Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/Observable/DelayTest.cs
index e0736f4a60..86f8983687 100644
--- a/Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/Observable/DelayTest.cs
+++ b/Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/Observable/DelayTest.cs
@@ -694,13 +694,13 @@ public void Delay_Never()
[TestMethod]
public void Delay_TimeSpan_DefaultScheduler()
{
- Assert.True(Observable.Return(1).Delay(TimeSpan.FromMilliseconds(1)).ToEnumerable().SequenceEqual(new[] { 1 }));
+ Assert.True(Observable.Return(1).Delay(TimeSpan.FromMilliseconds(1)).ToEnumerable().SequenceEqual([1]));
}
[TestMethod]
public void Delay_DateTimeOffset_DefaultScheduler()
{
- Assert.True(Observable.Return(1).Delay(DateTimeOffset.UtcNow + TimeSpan.FromMilliseconds(1)).ToEnumerable().SequenceEqual(new[] { 1 }));
+ Assert.True(Observable.Return(1).Delay(DateTimeOffset.UtcNow + TimeSpan.FromMilliseconds(1)).ToEnumerable().SequenceEqual([1]));
}
[TestMethod]
diff --git a/Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/Observable/ForEachTest.cs b/Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/Observable/ForEachTest.cs
index 658ecf1628..71d555de5d 100644
--- a/Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/Observable/ForEachTest.cs
+++ b/Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/Observable/ForEachTest.cs
@@ -34,7 +34,7 @@ public void ForEach_Empty()
{
var lst = new List();
Observable.Empty().ForEach(x => lst.Add(x));
- Assert.True(lst.SequenceEqual(Enumerable.Empty()));
+ Assert.True(lst.SequenceEqual([]));
}
[TestMethod]
@@ -42,7 +42,7 @@ public void ForEach_Index_Empty()
{
var lstX = new List();
Observable.Empty().ForEach((x, i) => lstX.Add(x));
- Assert.True(lstX.SequenceEqual(Enumerable.Empty()));
+ Assert.True(lstX.SequenceEqual([]));
}
[TestMethod]
@@ -50,7 +50,7 @@ public void ForEach_Return()
{
var lst = new List();
Observable.Return(42).ForEach(x => lst.Add(x));
- Assert.True(lst.SequenceEqual(new[] { 42 }));
+ Assert.True(lst.SequenceEqual([42]));
}
[TestMethod]
@@ -59,8 +59,8 @@ public void ForEach_Index_Return()
var lstX = new List();
var lstI = new List();
Observable.Return(42).ForEach((x, i) => { lstX.Add(x); lstI.Add(i); });
- Assert.True(lstX.SequenceEqual(new[] { 42 }));
- Assert.True(lstI.SequenceEqual(new[] { 0 }));
+ Assert.True(lstX.SequenceEqual([42]));
+ Assert.True(lstI.SequenceEqual([0]));
}
[TestMethod]
diff --git a/Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/Observable/ForkJoinTest.cs b/Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/Observable/ForkJoinTest.cs
index 0971242c5b..3a016b3466 100644
--- a/Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/Observable/ForkJoinTest.cs
+++ b/Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/Observable/ForkJoinTest.cs
@@ -312,7 +312,7 @@ public void ForkJoin_NaryParams()
var res = scheduler.Start(() => ObservableEx.ForkJoin(o1, o2, o3));
res.Messages.AssertEqual(
- OnNext(270, l => l.SequenceEqual(new[] { 4, 7, 5 })), // TODO: fix ForkJoin behavior
+ OnNext(270, l => l.SequenceEqual([4, 7, 5])), // TODO: fix ForkJoin behavior
OnCompleted(270)
);
}
@@ -424,7 +424,7 @@ public void ForkJoin_Nary_Virtual_And_Immediate()
var res = scheduler.Start(() => ObservableEx.ForkJoin(new List> { o1, o2, o3, Observable.Return(20) }));
res.Messages.AssertEqual(
- OnNext(270, l => l.SequenceEqual(new[] { 4, 7, 5, 20 })),
+ OnNext(270, l => l.SequenceEqual([4, 7, 5, 20])),
OnCompleted(270)
);
}
@@ -462,7 +462,7 @@ public void ForkJoin_Nary_Immediate_And_Virtual()
var res = scheduler.Start(() => ObservableEx.ForkJoin(new List> { Observable.Return(20), o1, o2, o3 }));
res.Messages.AssertEqual(
- OnNext(270, l => l.SequenceEqual(new[] { 20, 4, 7, 5 })),
+ OnNext(270, l => l.SequenceEqual([20, 4, 7, 5])),
OnCompleted(270)
);
}
@@ -500,7 +500,7 @@ public void ForkJoin_Nary()
var res = scheduler.Start(() => ObservableEx.ForkJoin(new List> { o1, o2, o3 }));
res.Messages.AssertEqual(
- OnNext(270, l => l.SequenceEqual(new[] { 4, 7, 5 })), // TODO: fix ForkJoin behavior
+ OnNext(270, l => l.SequenceEqual([4, 7, 5])), // TODO: fix ForkJoin behavior
OnCompleted(270)
);
}
diff --git a/Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/Observable/FromAsyncPatternTest.cs b/Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/Observable/FromAsyncPatternTest.cs
index 95e7075b89..4648d0f2ed 100644
--- a/Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/Observable/FromAsyncPatternTest.cs
+++ b/Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/Observable/FromAsyncPatternTest.cs
@@ -93,7 +93,7 @@ public void FromAsyncPattern0()
Func end = iar => { Assert.Same(x, iar); return 1; };
var res = Observable.FromAsyncPattern(begin, end)().Materialize().ToEnumerable().ToArray();
- Assert.True(res.SequenceEqual(new Notification[] { Notification.CreateOnNext(1), Notification.CreateOnCompleted() }));
+ Assert.True(res.SequenceEqual([Notification.CreateOnNext(1), Notification.CreateOnCompleted()]));
}
[TestMethod]
@@ -105,7 +105,7 @@ public void FromAsyncPatternAction0()
Action end = iar => { Assert.Same(x, iar); };
var res = Observable.FromAsyncPattern(begin, end)().ToEnumerable().ToArray();
- Assert.True(res.SequenceEqual(new[] { new Unit() }));
+ Assert.True(res.SequenceEqual([new Unit()]));
}
[TestMethod]
@@ -118,7 +118,7 @@ public void FromAsyncPattern0_Error()
Func end = iar => { Assert.Same(x, iar); throw ex; };
var res = Observable.FromAsyncPattern(begin, end)().Materialize().ToEnumerable().ToArray();
- Assert.True(res.SequenceEqual(new Notification[] { Notification.CreateOnError(ex) }));
+ Assert.True(res.SequenceEqual([Notification.CreateOnError(ex)]));
}
[TestMethod]
@@ -131,7 +131,7 @@ public void FromAsyncPattern0_ErrorBegin()
Func end = iar => { Assert.Same(x, iar); return 0; };
var res = Observable.FromAsyncPattern(begin, end)().Materialize().ToEnumerable().ToArray();
- Assert.True(res.SequenceEqual(new Notification[] { Notification.CreateOnError(ex) }));
+ Assert.True(res.SequenceEqual([Notification.CreateOnError(ex)]));
}
[TestMethod]
@@ -148,7 +148,7 @@ public void FromAsyncPattern1()
Func end = iar => { Assert.Same(x, iar); return 1; };
var res = Observable.FromAsyncPattern(begin, end)(2).Materialize().ToEnumerable().ToArray();
- Assert.True(res.SequenceEqual(new Notification