Skip to content

Commit 0381431

Browse files
committed
Some cleanup
1 parent f212983 commit 0381431

File tree

3 files changed

+7
-68
lines changed

3 files changed

+7
-68
lines changed

Akade.IndexedSet.Tests/CommonIndexTests/BaseIndexTest.RangeQueries.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ public void Range_based_methods_should_throw_if_not_supported()
1515
_ = Assert.ThrowsException<NotSupportedException>(() => index.GreaterThan(GetNotExistingKey()));
1616
_ = Assert.ThrowsException<NotSupportedException>(() => index.GreaterThanOrEqual(GetNotExistingKey()));
1717
_ = Assert.ThrowsException<NotSupportedException>(() => index.Min());
18-
_ = Assert.ThrowsException<NotSupportedException>(index.MinBy);
18+
_ = Assert.ThrowsException<NotSupportedException>(() => index.MinBy());
1919
_ = Assert.ThrowsException<NotSupportedException>(() => index.Max());
20-
_ = Assert.ThrowsException<NotSupportedException>(index.MaxBy);
20+
_ = Assert.ThrowsException<NotSupportedException>(() => index.MaxBy());
2121
_ = Assert.ThrowsException<NotSupportedException>(() => index.OrderBy(0));
2222
_ = Assert.ThrowsException<NotSupportedException>(() => index.OrderByDescending(0));
2323
}

Akade.IndexedSet.Tests/CommonIndexTests/CommonIndexTests.MultiValue.cs

-61
This file was deleted.

Akade.IndexedSet.Tests/Concurrency/ConcurrentSetTests.cs

+5-5
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public ConcurrentSetTests()
2222
[TestMethod]
2323
public async Task ParallelWrites()
2424
{
25-
ConcurrentIndexedSet<Person> sut = CreateSet();
25+
using ConcurrentIndexedSet<Person> sut = CreateSet();
2626

2727
Task[] tasks = _testData.Select(p => Task.Run(() => sut.Add(p))).ToArray();
2828
await Task.WhenAll(tasks);
@@ -33,7 +33,7 @@ public async Task ParallelWrites()
3333
[TestMethod]
3434
public async Task ParallelReads()
3535
{
36-
ConcurrentIndexedSet<Person> sut = CreateSet();
36+
using ConcurrentIndexedSet<Person> sut = CreateSet();
3737
_ = sut.AddRange(_testData);
3838

3939
Task<bool>[] tasks = _testData.Select(p => Task.Run(() => sut.TryGetSingle(x => x.Phone, p.Phone, out _))).ToArray();
@@ -44,7 +44,7 @@ public async Task ParallelReads()
4444
[TestMethod]
4545
public async Task ParallelReadsAndWrites()
4646
{
47-
ConcurrentIndexedSet<Person> sut = CreateSet();
47+
using ConcurrentIndexedSet<Person> sut = CreateSet();
4848
_ = sut.AddRange(_testData);
4949

5050
Task<bool>[] tasks = _testData.Select((p, i) => Task.Run(() =>
@@ -59,7 +59,7 @@ public async Task ParallelReadsAndWrites()
5959
[TestMethod]
6060
public async Task Update_method_allows_to_execute_code_in_isolation()
6161
{
62-
ConcurrentIndexedSet<int, TestData> sut = IndexedSetBuilder<TestData>.Create(x => x.PrimaryKey)
62+
using ConcurrentIndexedSet<int, TestData> sut = IndexedSetBuilder<TestData>.Create(x => x.PrimaryKey)
6363
.WithIndex(x => x.IntProperty)
6464
.BuildConcurrent();
6565
var element = new TestData(1, 0, GuidGen.Get(1), "Test");
@@ -77,7 +77,7 @@ await Task.WhenAll(Enumerable.Range(0, 100).Select(__ => Task.Run(() => sut.Upda
7777
[TestMethod]
7878
public async Task Parallel_reads_and_writes_with_read_method()
7979
{
80-
ConcurrentIndexedSet<int, TestData> sut = IndexedSetBuilder<TestData>.Create(x => x.PrimaryKey)
80+
using ConcurrentIndexedSet<int, TestData> sut = IndexedSetBuilder<TestData>.Create(x => x.PrimaryKey)
8181
.WithIndex(x => x.IntProperty)
8282
.WithIndex(x => x.GuidProperty)
8383
.BuildConcurrent();

0 commit comments

Comments
 (0)