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

fluentassertions / fluentassertions.datasets / 13245501597

10 Feb 2025 04:22PM UTC coverage: 94.362% (+0.3%) from 94.089%
13245501597

Pull #24

github

web-flow
Bump Verify.Xunit from 28.9.0 to 28.10.1 in the xunit group

Bumps the xunit group with 1 update: [Verify.Xunit](https://github.com/VerifyTests/Verify).


Updates `Verify.Xunit` from 28.9.0 to 28.10.1
- [Release notes](https://github.com/VerifyTests/Verify/releases)
- [Commits](https://github.com/VerifyTests/Verify/compare/28.9.0...28.10.1)

---
updated-dependencies:
- dependency-name: Verify.Xunit
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: xunit
...

Signed-off-by: dependabot[bot] <support@github.com>
Pull Request #24: Bump Verify.Xunit from 28.9.0 to 28.10.1 in the xunit group

458 of 498 branches covered (91.97%)

Branch coverage included in aggregate %.

1266 of 1329 relevant lines covered (95.26%)

2324.28 hits per line

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

12.5
/Src/FluentAssertions.DataSets/Common/Guard.cs
1
using System;
2
using System.Collections.Generic;
3
using System.Linq;
4
using System.Runtime.CompilerServices;
5
using JetBrains.Annotations;
6

7
namespace FluentAssertions.DataSets.Common;
8

9
internal static class Guard
10
{
11
    public static void ThrowIfArgumentIsNull<T>([ValidatedNotNull][NoEnumeration] T obj,
12
        [CallerArgumentExpression(nameof(obj))]
13
        string paramName = "")
14
    {
15
        if (obj is null)
632!
16
        {
17
            throw new ArgumentNullException(paramName);
×
18
        }
19
    }
632✔
20

21
    public static void ThrowIfArgumentIsNull<T>([ValidatedNotNull][NoEnumeration] T obj, string paramName, string message)
22
    {
23
        if (obj is null)
104✔
24
        {
25
            throw new ArgumentNullException(paramName, message);
12✔
26
        }
27
    }
92✔
28

29
    public static void ThrowIfArgumentIsNullOrEmpty([ValidatedNotNull] string str,
30
        [CallerArgumentExpression(nameof(str))]
31
        string paramName = "")
32
    {
33
        if (string.IsNullOrEmpty(str))
×
34
        {
35
            ThrowIfArgumentIsNull(str, paramName);
×
36
            throw new ArgumentException("The value cannot be an empty string.", paramName);
×
37
        }
38
    }
×
39

40
    public static void ThrowIfArgumentIsNullOrEmpty([ValidatedNotNull] string str, string paramName, string message)
41
    {
42
        if (string.IsNullOrEmpty(str))
×
43
        {
44
            ThrowIfArgumentIsNull(str, paramName, message);
×
45
            throw new ArgumentException(message, paramName);
×
46
        }
47
    }
×
48

49
    public static void ThrowIfArgumentIsOutOfRange<T>(T value, [CallerArgumentExpression(nameof(value))] string paramName = "")
50
        where T : Enum
51
    {
52
        if (!Enum.IsDefined(typeof(T), value))
×
53
        {
54
            throw new ArgumentOutOfRangeException(paramName);
×
55
        }
56
    }
×
57

58
    public static void ThrowIfArgumentContainsNull<T>(IEnumerable<T> values,
59
        [CallerArgumentExpression(nameof(values))]
60
        string paramName = "")
61
    {
62
        if (values.Any(t => t is null))
×
63
        {
64
            throw new ArgumentNullException(paramName, "Collection contains a null value");
×
65
        }
66
    }
×
67

68
    public static void ThrowIfArgumentIsEmpty<T>(IEnumerable<T> values, string paramName, string message)
69
    {
70
        if (!values.Any())
×
71
        {
72
            throw new ArgumentException(message, paramName);
×
73
        }
74
    }
×
75

76
    public static void ThrowIfArgumentIsEmpty(string str, string paramName, string message)
77
    {
78
        if (str.Length == 0)
×
79
        {
80
            throw new ArgumentException(message, paramName);
×
81
        }
82
    }
×
83

84
    public static void ThrowIfArgumentIsNegative(TimeSpan timeSpan,
85
        [CallerArgumentExpression(nameof(timeSpan))]
86
        string paramName = "")
87
    {
88
        if (timeSpan < TimeSpan.Zero)
×
89
        {
90
            throw new ArgumentOutOfRangeException(paramName, "The value must be non-negative.");
×
91
        }
92
    }
×
93

94
    public static void ThrowIfArgumentIsNegative(float value, [CallerArgumentExpression(nameof(value))] string paramName = "")
95
    {
96
        if (value < 0)
×
97
        {
98
            throw new ArgumentOutOfRangeException(paramName, "The value must be non-negative.");
×
99
        }
100
    }
×
101

102
    public static void ThrowIfArgumentIsNegative(double value, [CallerArgumentExpression(nameof(value))] string paramName = "")
103
    {
104
        if (value < 0)
×
105
        {
106
            throw new ArgumentOutOfRangeException(paramName, "The value must be non-negative.");
×
107
        }
108
    }
×
109

110
    public static void ThrowIfArgumentIsNegative(decimal value, [CallerArgumentExpression(nameof(value))] string paramName = "")
111
    {
112
        if (value < 0)
×
113
        {
114
            throw new ArgumentOutOfRangeException(paramName, "The value must be non-negative.");
×
115
        }
116
    }
×
117

118
    /// <summary>
119
    /// Workaround to make dotnet_code_quality.null_check_validation_methods work
120
    /// https://github.com/dotnet/roslyn-analyzers/issues/3451#issuecomment-606690452
121
    /// </summary>
122
    [AttributeUsage(AttributeTargets.Parameter)]
123
    private sealed class ValidatedNotNullAttribute : Attribute
124
    {
125
    }
126
}
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

© 2025 Coveralls, Inc