fix unittest more

master
neuecc 2021-04-06 13:05:52 +09:00
parent aa3216e48d
commit da8f599ccb
2 changed files with 7 additions and 7 deletions

View File

@ -126,7 +126,7 @@ namespace NetCoreTests.Linq
var ys = arr.ToLookup(x => x); var ys = arr.ToLookup(x => x);
xs.Count.Should().Be(ys.Count); xs.Count.Should().Be(ys.Count);
xs.OrderBy(x => x.Key).Should().Equal(ys.OrderBy(x => x.Key)); xs.Should().BeEquivalentTo(ys);
foreach (var key in xs.Select(x => x.Key)) foreach (var key in xs.Select(x => x.Key))
{ {
xs[key].Should().Equal(ys[key]); xs[key].Should().Equal(ys[key]);
@ -136,14 +136,14 @@ namespace NetCoreTests.Linq
var xs = await Enumerable.Range(1, 0).ToUniTaskAsyncEnumerable().ToLookupAsync(x => x); var xs = await Enumerable.Range(1, 0).ToUniTaskAsyncEnumerable().ToLookupAsync(x => x);
var ys = Enumerable.Range(1, 0).ToLookup(x => x); var ys = Enumerable.Range(1, 0).ToLookup(x => x);
xs.OrderBy(x => x.Key).Should().Equal(ys.OrderBy(x => x.Key)); xs.Should().BeEquivalentTo(ys);
} }
{ {
var xs = await arr.ToUniTaskAsyncEnumerable().ToLookupAsync(x => x, x => x * 2); var xs = await arr.ToUniTaskAsyncEnumerable().ToLookupAsync(x => x, x => x * 2);
var ys = arr.ToLookup(x => x, x => x * 2); var ys = arr.ToLookup(x => x, x => x * 2);
xs.Count.Should().Be(ys.Count); xs.Count.Should().Be(ys.Count);
xs.OrderBy(x => x.Key).Should().Equal(ys.OrderBy(x => x.Key)); xs.Should().BeEquivalentTo(ys);
foreach (var key in xs.Select(x => x.Key)) foreach (var key in xs.Select(x => x.Key))
{ {
xs[key].Should().Equal(ys[key]); xs[key].Should().Equal(ys[key]);
@ -153,7 +153,7 @@ namespace NetCoreTests.Linq
var xs = await Enumerable.Range(1, 0).ToUniTaskAsyncEnumerable().ToLookupAsync(x => x, x => x * 2); var xs = await Enumerable.Range(1, 0).ToUniTaskAsyncEnumerable().ToLookupAsync(x => x, x => x * 2);
var ys = Enumerable.Range(1, 0).ToLookup(x => x, x => x * 2); var ys = Enumerable.Range(1, 0).ToLookup(x => x, x => x * 2);
xs.OrderBy(x => x.Key).Should().Equal(ys.OrderBy(x => x.Key)); xs.Should().BeEquivalentTo(ys);
} }
} }

View File

@ -123,7 +123,7 @@ namespace NetCoreTests.Linq
var ys = arr.GroupBy(x => x).ToArray(); var ys = arr.GroupBy(x => x).ToArray();
xs.Length.Should().Be(ys.Length); xs.Length.Should().Be(ys.Length);
xs.OrderBy(x => x.Key).Should().Equal(ys.OrderBy(x => x.Key)); xs.Should().BeEquivalentTo(ys);
} }
{ {
@ -139,7 +139,7 @@ namespace NetCoreTests.Linq
var ys = arr.GroupBy(x => x).ToArray(); var ys = arr.GroupBy(x => x).ToArray();
xs.Length.Should().Be(ys.Length); xs.Length.Should().Be(ys.Length);
xs.OrderBy(x => x.Key).Should().Equal(ys.OrderBy(x => x.Key)); xs.Should().BeEquivalentTo(ys);
} }
{ {
@ -155,7 +155,7 @@ namespace NetCoreTests.Linq
var ys = arr.GroupBy(x => x).ToArray(); var ys = arr.GroupBy(x => x).ToArray();
xs.Length.Should().Be(ys.Length); xs.Length.Should().Be(ys.Length);
xs.OrderBy(x => x.Key).Should().Equal(ys.OrderBy(x => x.Key)); xs.Should().BeEquivalentTo(ys);
} }
{ {