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

fluentassertions / fluentassertions.datasets / 13090818501

01 Feb 2025 05:24PM UTC coverage: 94.362%. Remained the same
13090818501

Pull #20

github

web-flow
Revert "Bump FluentAssertions from 8.0.0 to 8.0.1"

This reverts commit 6012f9891.
Pull Request #20: Revert "Bump FluentAssertions from 8.0.0 to 8.0.1"

458 of 498 branches covered (91.97%)

Branch coverage included in aggregate %.

1266 of 1329 relevant lines covered (95.26%)

4648.54 hits per line

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

78.13
/Src/FluentAssertions.DataSets/Common/ReadOnlyNonGenericCollectionWrapper.cs
1
using System;
2
using System.Collections;
3
using System.Collections.Generic;
4
using System.Data;
5
using System.Linq;
6

7
namespace FluentAssertions.DataSets.Common;
8

9
internal static class ReadOnlyNonGenericCollectionWrapper
10
{
11
    public static ReadOnlyNonGenericCollectionWrapper<DataTableCollection, DataTable> Create(DataTableCollection collection)
12
    {
13
        return
64✔
14
            collection != null
64✔
15
                ? new ReadOnlyNonGenericCollectionWrapper<DataTableCollection, DataTable>(collection)
64✔
16
                : null;
64✔
17
    }
18

19
    public static ReadOnlyNonGenericCollectionWrapper<DataColumnCollection, DataColumn> Create(DataColumnCollection collection)
20
    {
21
        return
48✔
22
            collection != null
48✔
23
                ? new ReadOnlyNonGenericCollectionWrapper<DataColumnCollection, DataColumn>(collection)
48✔
24
                : null;
48✔
25
    }
26

27
    public static ReadOnlyNonGenericCollectionWrapper<DataRowCollection, DataRow> Create(DataRowCollection collection)
28
    {
29
        return
72✔
30
            collection != null
72✔
31
                ? new ReadOnlyNonGenericCollectionWrapper<DataRowCollection, DataRow>(collection)
72✔
32
                : null;
72✔
33
    }
34
}
35

36
internal class ReadOnlyNonGenericCollectionWrapper<TCollection, TItem> : ICollection<TItem>, ICollectionWrapper<TCollection>
37
    where TCollection : ICollection
38
{
39
    public TCollection UnderlyingCollection { get; }
136✔
40

41
    /// <summary>
42
    /// Initializes a new instance of the <see cref="ReadOnlyNonGenericCollectionWrapper{TCollection, TItem}"/> class.
43
    /// </summary>
44
    /// <exception cref="ArgumentNullException"><paramref name="collection"/> is <see langword="null"/>.</exception>
45
    public ReadOnlyNonGenericCollectionWrapper(TCollection collection)
152✔
46
    {
47
        Guard.ThrowIfArgumentIsNull(collection);
152✔
48

49
        UnderlyingCollection = collection;
152✔
50
    }
152✔
51

52
    public int Count => UnderlyingCollection.Count;
64✔
53

54
    bool ICollection<TItem>.IsReadOnly => true;
×
55

56
    public IEnumerator<TItem> GetEnumerator() => UnderlyingCollection.Cast<TItem>().GetEnumerator();
24✔
57

58
    IEnumerator IEnumerable.GetEnumerator() => UnderlyingCollection.GetEnumerator();
×
59

60
    public bool Contains(TItem item) => UnderlyingCollection.Cast<TItem>().Contains(item);
×
61

62
    public void CopyTo(TItem[] array, int arrayIndex) => UnderlyingCollection.CopyTo(array, arrayIndex);
×
63

64
    void ICollection<TItem>.Add(TItem item) => throw new NotSupportedException();
×
65

66
    void ICollection<TItem>.Clear() => throw new NotSupportedException();
×
67

68
    bool ICollection<TItem>.Remove(TItem item) => throw new NotSupportedException();
×
69
}
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