Skip to content

Commit

Permalink
Drop RangeExtensions from tests as it's easier than troubleshooting d…
Browse files Browse the repository at this point in the history
…ependency conflicts in a multi-target project
  • Loading branch information
neon-sunset committed Dec 10, 2022
1 parent 6f526b4 commit 3a79888
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
2 changes: 0 additions & 2 deletions tests/FastCache.CachedTests/FastCache.CachedTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="RangeExtensions" Version="1.2.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.0" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
Expand All @@ -25,7 +24,6 @@
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net48' ">
<PackageReference Include="IndexRange" Version="1.0.2" />
<PackageReference Include="System.Buffers" Version="4.5.1" />
<PackageReference Include="System.Memory" Version="4.5.5" />
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
Expand Down
9 changes: 4 additions & 5 deletions tests/FastCache.CachedTests/Internals/CacheManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using FastCache.Extensions;
using FastCache.Services;
using FastCache.Helpers;
using System.Linq;

namespace FastCache.CachedTests.Internals;

Expand All @@ -22,8 +21,8 @@ public void TotalCount_ReturnsCorrectValue()
{
const int expectedCount = 32768;

var entries = (0..32768)
.AsEnumerable()
var entries = Enumerable
.Range(0, 32768)
.Select(i => (i, new TotalCountEntry(i)));

CachedRange<TotalCountEntry>.Save(entries, TimeSpan.MaxValue);
Expand All @@ -34,8 +33,8 @@ public void TotalCount_ReturnsCorrectValue()
[Fact]
public async Task EnumerateEntries_ReturnsCorrectValues()
{
var expired = (0..1024).AsEnumerable().ToDictionary(i => i, _ => new EnumerableEntry());
var notExpired = (1024..2048).AsEnumerable().ToDictionary(i => i, _ => new EnumerableEntry());
var expired = Enumerable.Range(0, 1024).ToDictionary(i => i, _ => new EnumerableEntry());
var notExpired = Enumerable.Range(1024, 1024).ToDictionary(i => i, _ => new EnumerableEntry());

CachedRange<EnumerableEntry>.Save(expired.Select(kvp => (kvp.Key, kvp.Value)), DelayTolerance);
CachedRange<EnumerableEntry>.Save(notExpired.Select(kvp => (kvp.Key, kvp.Value)), DelayTolerance.MultiplyBy(2));
Expand Down

0 comments on commit 3a79888

Please sign in to comment.