Skip to content

Commit 2b9c052

Browse files
committed
warning fixes
1 parent 0842f4d commit 2b9c052

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

test/AutSoft.Linq.Tests/Queryable/OrderByExtensions/OrderByExtensionsTests.OrderByFromMappings.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public partial class OrderByFromMappings : OrderByExtensionsTests
1515
[InlineData(nameof(PersonDto.Id))]
1616
[InlineData(nameof(PersonDto.Name))]
1717
[InlineData(nameof(PersonDto.Age))]
18-
public async Task Should_ReturnOrdered(string orderBy)
18+
public void Should_ReturnOrdered(string orderBy)
1919
{
2020
// Act
2121
var ordered = Subject
@@ -27,7 +27,7 @@ public async Task Should_ReturnOrdered(string orderBy)
2727
ordered.Should().HaveCount(Subject.Count());
2828
ordered.Should().BeInAscendingOrder(orderBy switch
2929
{
30-
nameof(PersonDto.Id) => (Expression<Func<PersonDto, object>>)(p => p.Id),
30+
nameof(PersonDto.Id) => (Expression<Func<PersonDto, object?>>)(p => p.Id),
3131
nameof(PersonDto.Name) => p => p.Name,
3232
nameof(PersonDto.Age) => p => p.Age,
3333
_ => throw new NotSupportedException("Not valid test case input"),

test/AutSoft.Linq.Tests/Queryable/OrderByExtensions/OrderByExtensionsTests.cs

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,25 @@ public OrderByExtensionsTests()
3232
private protected IMapper Mapper { get; }
3333
private protected PersonDbContext DbContext { get; }
3434

35+
private bool _disposedValue;
36+
37+
protected virtual void Dispose(bool disposing)
38+
{
39+
if (!_disposedValue)
40+
{
41+
if (disposing)
42+
{
43+
DbContext.Dispose();
44+
}
45+
46+
_disposedValue = true;
47+
}
48+
}
49+
3550
public void Dispose()
3651
{
37-
DbContext.Dispose();
52+
// Do not change this code. Put cleanup code in 'Dispose(bool disposing)' method
53+
Dispose(disposing: true);
54+
GC.SuppressFinalize(this);
3855
}
3956
}

0 commit comments

Comments
 (0)