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

bitfaster / BitFaster.Caching / 13341524291

15 Feb 2025 03:53AM UTC coverage: 98.952% (-0.2%) from 99.168%
13341524291

Pull #638

github

web-flow
Merge 42248d7f5 into 56d0d7868
Pull Request #638: provide a net9 build target

1120 of 1146 branches covered (97.73%)

Branch coverage included in aggregate %.

8 of 9 new or added lines in 2 files covered. (88.89%)

9 existing lines in 1 file now uncovered.

4829 of 4866 relevant lines covered (99.24%)

51719223.19 hits per line

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

90.91
/BitFaster.Caching/Throw.cs
1
using System;
2
using System.Diagnostics;
3
using System.Diagnostics.CodeAnalysis;
4
using System.Runtime.CompilerServices;
5

6
namespace BitFaster.Caching
7
{
8
    internal static class Throw
9
    {
10
        [DoesNotReturn]
11
        public static void ArgNull(ExceptionArgument arg) => throw CreateArgumentNullException(arg);
40✔
12

13
        [DoesNotReturn]
14
        public static void ArgOutOfRange(string paramName) => throw CreateArgumentOutOfRangeException(paramName);
28✔
15

16
        [DoesNotReturn]
17
        public static void ArgOutOfRange(string paramName, string message) => throw CreateArgumentOutOfRangeException(paramName, message);
68✔
18

19
        [ExcludeFromCodeCoverage]
20
        [DoesNotReturn]
21
        public static void InvalidOp(string message) => throw CreateInvalidOperationException(message);
22

23
        [DoesNotReturn]
24
        public static void ScopedRetryFailure() => throw CreateScopedRetryFailure();
20✔
25

26
        [DoesNotReturn]
27
        public static void Disposed<T>() => throw CreateObjectDisposedException<T>();
4✔
28

29
        [DoesNotReturn]
NEW
30
        public static void IncompatibleComparer() => throw new InvalidOperationException("Incompatible comparer");
×
31

32
        [MethodImpl(MethodImplOptions.NoInlining)]
33
        private static ArgumentNullException CreateArgumentNullException(ExceptionArgument arg) => new ArgumentNullException(GetArgumentString(arg));
40✔
34

35
        [MethodImpl(MethodImplOptions.NoInlining)]
36
        private static ArgumentOutOfRangeException CreateArgumentOutOfRangeException(string paramName) => new ArgumentOutOfRangeException(paramName);
28✔
37

38
        [MethodImpl(MethodImplOptions.NoInlining)]
39
        private static ArgumentOutOfRangeException CreateArgumentOutOfRangeException(string paramName, string message) => new ArgumentOutOfRangeException(paramName, message);
68✔
40

41
        [ExcludeFromCodeCoverage]
42
        [MethodImpl(MethodImplOptions.NoInlining)]
43
        private static InvalidOperationException CreateInvalidOperationException(string message) => new InvalidOperationException(message);
44

45
        [MethodImpl(MethodImplOptions.NoInlining)]
46
        private static InvalidOperationException CreateScopedRetryFailure() => new InvalidOperationException(ScopedCacheDefaults.RetryFailureMessage);
20✔
47
        
48
        [MethodImpl(MethodImplOptions.NoInlining)]
49
        private static ObjectDisposedException CreateObjectDisposedException<T>() => new ObjectDisposedException(typeof(T).Name);
4✔
50

51
        [ExcludeFromCodeCoverage]
52
        private static string GetArgumentString(ExceptionArgument argument)
53
        {
54
            switch (argument)
55
            {
56
                case ExceptionArgument.cache: return nameof(ExceptionArgument.cache);
57
                case ExceptionArgument.comparer: return nameof(ExceptionArgument.comparer);
58
                case ExceptionArgument.scoped: return nameof(ExceptionArgument.scoped);
59
                case ExceptionArgument.capacity: return nameof(ExceptionArgument.capacity);
60
                case ExceptionArgument.node: return nameof(ExceptionArgument.node);
61
                case ExceptionArgument.expiry: return nameof(ExceptionArgument.expiry);
62
                default:
63
                    Debug.Fail("The ExceptionArgument value is not defined.");
64
                    return string.Empty;
65
            }
66
        }
67
    }
68

69
    internal enum ExceptionArgument
70
    {
71
        cache,
72
        comparer,
73
        scoped,
74
        capacity,
75
        node,
76
        expiry,
77
    }
78
}
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