# WireMock.Util.ConcurentObservableCollection`1 - Coverage Report

# Summary

Class: | WireMock.Util.ConcurentObservableCollection`1
Assembly: | WireMock.Net
File(s): | C:\Users\azureuser\Documents\Github\WireMock.Net\src\WireMock.Net\Util\ConcurentObservableCollection.cs
Covered lines: | 20
Uncovered lines: | 14
Coverable lines: | 34
Total lines: | 77
Line coverage: | 58.8%

# Metrics

Method | Cyclomatic complexity | NPath complexity | Sequence coverage | Branch coverage
--- | --- | --- | --- | ---
.ctor() | 1 | 0 | 100 | 100
.ctor(...) | 1 | 0 | 0 | 0
.ctor(...) | 1 | 0 | 0 | 0
ClearItems() | 2 | 0 | 100 | 100
RemoveItem(...) | 2 | 0 | 100 | 100
InsertItem(...) | 2 | 0 | 100 | 100
SetItem(...) | 2 | 0 | 0 | 0
MoveItem(...) | 2 | 0 | 0 | 0

# File(s)

## C:\Users\azureuser\Documents\Github\WireMock.Net\src\WireMock.Net\Util\ConcurentObservableCollection.cs

| # | Line |  | Line coverage
--- | --- | --- | --- | ---
|  | `1` |  | `using System.Collections.Generic;`
|  | `2` |  | `using System.Collections.ObjectModel;`
|  | `3` |  | ``
|  | `4` |  | `namespace WireMock.Util`
|  | `5` |  | `{`
|  | `6` |  | `/// <summary>`
|  | `7` |  | `/// A special Collection that overrides methods of <see cref="ObservableCollection{T}"/> to make them thread safe`
|  | `8` |  | `/// </summary>`
|  | `9` |  | `/// <typeparam name="T">The type of elements in the collection.</typeparam>`
|  | `10` |  | `/// <inheritdoc cref="ObservableCollection{T}" />`
|  | `11` |  | `public class ConcurentObservableCollection<T> : ObservableCollection<T>`
|  | `12` |  | `{`
| 47 | `13` |  | `private readonly object _lockObject = new object();`
|  | `14` |  | ``
|  | `15` |  | `/// <summary>`
|  | `16` |  | `/// Initializes a new instance of the <see cref="T:WireMock.Util.ConcurentObservableCollection`1" /> class.`
|  | `17` |  | `/// </summary>`
| 141 | `18` |  | `public ConcurentObservableCollection() { }`
|  | `19` |  | ``
|  | `20` |  | `/// <summary>`
|  | `21` |  | `/// Initializes a new instance of the <see cref="ConcurentObservableCollection{T}"/> class that contains element`
|  | `22` |  | `/// </summary>`
|  | `23` |  | `/// <param name="list">The list from which the elements are copied.</param>`
| 0 | `24` |  | `public ConcurentObservableCollection(List<T> list) : base(list) { }`
|  | `25` |  | ``
|  | `26` |  | `/// <summary>`
|  | `27` |  | `/// Initializes a new instance of the <see cref="ConcurentObservableCollection{T}"/> class that contains element`
|  | `28` |  | `/// </summary>`
|  | `29` |  | `/// <param name="collection">The collection from which the elements are copied.</param>`
| 0 | `30` |  | `public ConcurentObservableCollection(IEnumerable<T> collection) : base(collection) { }`
|  | `31` |  | ``
|  | `32` |  | `/// <inheritdoc cref="ObservableCollection{T}.ClearItems"/>`
|  | `33` |  | `protected override void ClearItems()`
| 1 | `34` |  | `{`
| 1 | `35` |  | `lock (_lockObject)`
| 1 | `36` |  | `{`
| 1 | `37` |  | `base.ClearItems();`
| 1 | `38` |  | `}`
| 1 | `39` |  | `}`
|  | `40` |  | ``
|  | `41` |  | `/// <inheritdoc cref="ObservableCollection{T}.RemoveItem"/>`
|  | `42` |  | `protected override void RemoveItem(int index)`
| 1 | `43` |  | `{`
| 1 | `44` |  | `lock (_lockObject)`
| 1 | `45` |  | `{`
| 1 | `46` |  | `base.RemoveItem(index);`
| 1 | `47` |  | `}`
| 1 | `48` |  | `}`
|  | `49` |  | ``
|  | `50` |  | `/// <inheritdoc cref="ObservableCollection{T}.InsertItem"/>`
|  | `51` |  | `protected override void InsertItem(int index, T item)`
| 53 | `52` |  | `{`
| 53 | `53` |  | `lock (_lockObject)`
| 53 | `54` |  | `{`
| 53 | `55` |  | `base.InsertItem(index, item);`
| 53 | `56` |  | `}`
| 53 | `57` |  | `}`
|  | `58` |  | ``
|  | `59` |  | `/// <inheritdoc cref="ObservableCollection{T}.SetItem"/>`
|  | `60` |  | `protected override void SetItem(int index, T item)`
| 0 | `61` |  | `{`
| 0 | `62` |  | `lock (_lockObject)`
| 0 | `63` |  | `{`
| 0 | `64` |  | `base.SetItem(index, item);`
| 0 | `65` |  | `}`
| 0 | `66` |  | `}`
|  | `67` |  | ``
|  | `68` |  | `/// <inheritdoc cref="ObservableCollection{T}.MoveItem"/>`
|  | `69` |  | `protected override void MoveItem(int oldIndex, int newIndex)`
| 0 | `70` |  | `{`
| 0 | `71` |  | `lock (_lockObject)`
| 0 | `72` |  | `{`
| 0 | `73` |  | `base.MoveItem(oldIndex, newIndex);`
| 0 | `74` |  | `}`
| 0 | `75` |  | `}`
|  | `76` |  | `}`
|  | `77` |  | `}`

# Methods/Properties

.ctor()
.ctor(System.Collections.Generic.List`1<T>)
.ctor(System.Collections.Generic.IEnumerable`1<T>)
ClearItems()
RemoveItem(System.Int32)
InsertItem(System.Int32,T)
SetItem(System.Int32,T)
MoveItem(System.Int32,System.Int32)