# 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
--- | --- | --- | --- | ---
ClearItems() | 0 | 0 | 1 | 0
RemoveItem(...) | 0 | 0 | 1 | 0
InsertItem(...) | 0 | 0 | 1 | 0
SetItem(...) | 0 | 0 | 0 | 0
MoveItem(...) | 0 | 0 | 0 | 0
.ctor() | 0 | 0 | 1 | 0
.ctor(...) | 0 | 0 | 0 | 0
.ctor(...) | 0 | 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` |  | `{`
| 55 | `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>`
| 165 | `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()`
| 9 | `34` |  | `{`
| 9 | `35` |  | `lock (_lockObject)`
| 9 | `36` |  | `{`
| 9 | `37` |  | `base.ClearItems();`
| 9 | `38` |  | `}`
| 9 | `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)`
| 57 | `52` |  | `{`
| 57 | `53` |  | `lock (_lockObject)`
| 57 | `54` |  | `{`
| 57 | `55` |  | `base.InsertItem(index, item);`
| 57 | `56` |  | `}`
| 57 | `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)