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

loresoft / EntityChange / 10792597827

10 Sep 2024 12:38PM UTC coverage: 39.608%. Remained the same
10792597827

push

github

web-flow
Merge pull request #103 from loresoft/dependabot/nuget/MinVer-6.0.0

Bump MinVer from 5.0.0 to 6.0.0

237 of 731 branches covered (32.42%)

Branch coverage included in aggregate %.

571 of 1309 relevant lines covered (43.62%)

60.49 hits per line

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

16.67
/src/EntityChange/StringEquality.cs
1
namespace EntityChange;
2

3
/// <summary>
4
/// A <see langword="static"/> class for string equality comparison
5
/// </summary>
6
public static class StringEquality
7
{
8
    /// <summary>
9
    /// Determines whether the specified <paramref name="original"/> and <paramref name="current"/> 
10
    /// strings have the same value using <see cref="StringComparison.CurrentCulture"/> option.
11
    /// </summary>
12
    /// <param name="original">The original string to compare.</param>
13
    /// <param name="current">The current string to compare.</param>
14
    /// <returns><c>true</c> if <paramref name="original"/> is equal <paramref name="current"/>; otherwise, <c>false</c>.</returns>
15
    public static bool CurrentCulture(object original, object current)
16
    {
17
        string o = original as string;
×
18
        string c = current as string;
×
19

20
        return string.Equals(o, c, StringComparison.CurrentCulture);
×
21
    }
22

23
    /// <summary>
24
    /// Determines whether the specified <paramref name="original"/> and <paramref name="current"/> 
25
    /// strings have the same value using <see cref="StringComparison.CurrentCultureIgnoreCase"/> option.
26
    /// </summary>
27
    /// <param name="original">The original string to compare.</param>
28
    /// <param name="current">The current string to compare.</param>
29
    /// <returns><c>true</c> if <paramref name="original"/> is equal <paramref name="current"/>; otherwise, <c>false</c>.</returns>
30
    public static bool CurrentCultureIgnoreCase(object original, object current)
31
    {
32
        string o = original as string;
×
33
        string c = current as string;
×
34

35
        return string.Equals(o, c, StringComparison.CurrentCultureIgnoreCase);
×
36
    }
37

38
#if !NETSTANDARD1_0 && !NETSTANDARD1_5
39
    /// <summary>
40
    /// Determines whether the specified <paramref name="original"/> and <paramref name="current"/> 
41
    /// strings have the same value using <see cref="StringComparison.InvariantCulture"/> option.
42
    /// </summary>
43
    /// <param name="original">The original string to compare.</param>
44
    /// <param name="current">The current string to compare.</param>
45
    /// <returns><c>true</c> if <paramref name="original"/> is equal <paramref name="current"/>; otherwise, <c>false</c>.</returns>
46
    public static bool InvariantCulture(object original, object current)
47
    {
48
        string o = original as string;
×
49
        string c = current as string;
×
50

51
        return string.Equals(o, c, StringComparison.InvariantCulture);
×
52
    }
53

54
    /// <summary>
55
    /// Determines whether the specified <paramref name="original"/> and <paramref name="current"/> 
56
    /// strings have the same value using <see cref="StringComparison.InvariantCultureIgnoreCase"/> option.
57
    /// </summary>
58
    /// <param name="original">The original string to compare.</param>
59
    /// <param name="current">The current string to compare.</param>
60
    /// <returns><c>true</c> if <paramref name="original"/> is equal <paramref name="current"/>; otherwise, <c>false</c>.</returns>
61
    public static bool InvariantCultureIgnoreCase(object original, object current)
62
    {
63
        string o = original as string;
×
64
        string c = current as string;
×
65

66
        return string.Equals(o, c, StringComparison.InvariantCultureIgnoreCase);
×
67
    }
68
#endif
69

70
    /// <summary>
71
    /// Determines whether the specified <paramref name="original"/> and <paramref name="current"/> 
72
    /// strings have the same value using <see cref="StringComparison.Ordinal"/> option.
73
    /// </summary>
74
    /// <param name="original">The original string to compare.</param>
75
    /// <param name="current">The current string to compare.</param>
76
    /// <returns><c>true</c> if <paramref name="original"/> is equal <paramref name="current"/>; otherwise, <c>false</c>.</returns>
77
    public static bool Ordinal(object original, object current)
78
    {
79
        string o = original as string;
×
80
        string c = current as string;
×
81

82
        return string.Equals(o, c, StringComparison.Ordinal);
×
83
    }
84

85
    /// <summary>
86
    /// Determines whether the specified <paramref name="original"/> and <paramref name="current"/> 
87
    /// strings have the same value using <see cref="StringComparison.OrdinalIgnoreCase"/> option.
88
    /// </summary>
89
    /// <param name="original">The original string to compare.</param>
90
    /// <param name="current">The current string to compare.</param>
91
    /// <returns><c>true</c> if <paramref name="original"/> is equal <paramref name="current"/>; otherwise, <c>false</c>.</returns>
92
    public static bool OrdinalIgnoreCase(object original, object current)
93
    {
94
        string o = original as string;
5✔
95
        string c = current as string;
5✔
96

97
        return string.Equals(o, c, StringComparison.OrdinalIgnoreCase);
5✔
98
    }
99
}
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