• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

neon-sunset / fast-cache / 11334749816

14 Oct 2024 08:43PM UTC coverage: 91.41%. Remained the same
11334749816

Pull #123

github

web-flow
Bump Microsoft.Extensions.Caching.Memory in /src/FastCache.Benchmarks

Bumps [Microsoft.Extensions.Caching.Memory](https://github.com/dotnet/runtime) from 8.0.0 to 8.0.1.
- [Release notes](https://github.com/dotnet/runtime/releases)
- [Commits](https://github.com/dotnet/runtime/compare/v8.0.0...v8.0.1)

---
updated-dependencies:
- dependency-name: Microsoft.Extensions.Caching.Memory
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Pull Request #123: Bump Microsoft.Extensions.Caching.Memory from 8.0.0 to 8.0.1 in /src/FastCache.Benchmarks

339 of 418 branches covered (81.1%)

Branch coverage included in aggregate %.

1768 of 1887 relevant lines covered (93.69%)

1116.37 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

90.91
/tests/FastCache.CachedTests/Cached_InputValidation.cs
1
namespace FastCache.CachedTests;
2

3
public sealed class CachedTests_InputValidation
4
{
5
    public static IEnumerable<object[]> ValidExpirations()
6
    {
7
        yield return new object[] { TimeSpan.FromTicks(1) };
1✔
8
        yield return new object[] { TimeSpan.FromMilliseconds(1) };
1✔
9
        yield return new object[] { TimeSpan.FromSeconds(1) };
1✔
10
        yield return new object[] { TimeSpan.FromMinutes(1) };
1✔
11
        yield return new object[] { TimeSpan.FromHours(1) };
1✔
12
        yield return new object[] { TimeSpan.FromDays(1) };
1✔
13
        yield return new object[] { TimeSpan.MaxValue };
1✔
14
    }
1✔
15

16
    public static IEnumerable<object[]> InvalidExpirations()
17
    {
18
        yield return new object[] { TimeSpan.Zero };
1✔
19
        yield return new object[] { TimeSpan.MinValue };
1✔
20
        yield return new object[] { TimeSpan.FromTicks(-1) };
1✔
21
        yield return new object[] { TimeSpan.FromMilliseconds(-1) };
1✔
22
        yield return new object[] { TimeSpan.FromSeconds(-1) };
1✔
23
        yield return new object[] { TimeSpan.FromMinutes(-1) };
1✔
24
        yield return new object[] { TimeSpan.FromHours(-1) };
1✔
25
        yield return new object[] { TimeSpan.FromDays(-1) };
1✔
26
    }
1✔
27

28
    [Fact]
29
    public void CachedDefaultConstructor_AlwaysThrows()
30
    {
31
        static void RunCtor()
32
        {
33
            _ = new Cached<string, string>();
1✔
34
        }
×
35

36
        Assert.Throws<InvalidOperationException>(RunCtor);
1✔
37
    }
1✔
38

39
    [Theory]
40
    [MemberData(nameof(InvalidExpirations))]
41
    public void Cached_Save_ThrowsOnInvalidExpiration(TimeSpan expiration)
42
    {
43
        void SaveInvalidExpiration()
44
        {
45
            if (!Cached<string>.TryGet(GetTestKey(expiration), out var cached))
8!
46
            {
47
                cached.Save(GetRandomString(), expiration);
8✔
48
            }
49
        }
×
50

51
        Assert.Throws<ArgumentOutOfRangeException>(SaveInvalidExpiration);
8✔
52
    }
8✔
53

54
    [Theory]
55
    [MemberData(nameof(ValidExpirations))]
56
    public void Cached_Save_DoesNotThrowOnValidExpiration(TimeSpan expiration)
57
    {
58
        Cached<string>.TryGet(GetTestKey(expiration), out var cached);
7✔
59
        cached.Save(GetRandomString(), expiration);
7✔
60
    }
7✔
61
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc