Summary

Class:WireMock.Util.WireMockList`1
Assembly:WireMock.Net
File(s):C:\Users\Stef\Documents\GitHub\WireMock.Net\src\WireMock.Net\Util\WireMockList.cs
Covered lines:7
Uncovered lines:7
Coverable lines:14
Total lines:50
Line coverage:50%
Branch coverage:50%

Metrics

MethodCyclomatic complexity  NPath complexity  Sequence coverage  Branch coverage  
.ctor()10100100
.ctor(...)1000
.ctor(...)1000
ToString()348060

File(s)

C:\Users\Stef\Documents\GitHub\WireMock.Net\src\WireMock.Net\Util\WireMockList.cs

#LineLine coverage
 1using System.Collections.Generic;
 2using System.Linq;
 3
 4namespace WireMock.Util
 5{
 6    /// <summary>
 7    /// A special List which overrides the ToString() to return first value.
 8    /// </summary>
 9    /// <typeparam name="T">The generic type</typeparam>
 10    /// <seealso cref="List{T}" />
 11    public class WireMockList<T> : List<T>
 12    {
 13        /// <summary>
 14        /// Initializes a new instance of the <see cref="WireMockList{T}"/> class.
 15        /// </summary>
 716        public WireMockList()
 717        {
 718        }
 19
 20        /// <summary>
 21        /// Initializes a new instance of the <see cref="WireMockList{T}"/> class.
 22        /// </summary>
 23        /// <param name="collection">The collection whose elements are copied to the new list.</param>
 024        public WireMockList(params T[] collection) : base(collection)
 025        {
 026        }
 27
 28        /// <summary>
 29        /// Initializes a new instance of the <see cref="WireMockList{T}"/> class.
 30        /// </summary>
 31        /// <param name="collection">The collection whose elements are copied to the new list.</param>
 032        public WireMockList(IEnumerable<T> collection) : base(collection)
 033        {
 034        }
 35
 36        /// <summary>
 37        /// Returns a <see cref="string" /> that represents this instance.
 38        /// </summary>
 39        /// <returns>
 40        /// A <see cref="string" /> that represents this instance.
 41        /// </returns>
 42        public override string ToString()
 243        {
 244             if (this != null && this.Any())
 245                return this.First().ToString();
 46
 047            return base.ToString();
 248        }
 49    }
 50}