# < Summary

Information

Class: | Renci.SshNet.ExpectAction
Assembly: | Renci.SshNet
File(s): | \home\appveyor\projects\ssh-net\src\Renci.SshNet\ExpectAction.cs

Line coverage
66%

Covered lines: | 16
Uncovered lines: | 8
Coverable lines: | 24
Total lines: | 65
Line coverage: | 66.6%

Branch coverage
50%

Covered branches: | 4
Total branches: | 8
Branch coverage: | 50%

Method coverage

Feature is only available for sponsors

Upgrade to PRO version

# Metrics

Method | Branch coverage | Cyclomatic complexity | Line coverage
--- | --- | --- | ---
get_Expect() | 100% | 1 | 100%
get_Action() | 100% | 1 | 100%
.ctor(...) | 50% | 4 | 63.63%
.ctor(...) | 50% | 4 | 63.63%

# File(s)

## \home\appveyor\projects\ssh-net\src\Renci.SshNet\ExpectAction.cs

| # | Line |  | Line coverage
--- | --- | --- | --- | ---
|  | `1` |  | `using System;`
|  | `2` |  | `using System.Text.RegularExpressions;`
|  | `3` |  | ``
|  | `4` |  | `namespace Renci.SshNet`
|  | `5` |  | `{`
|  | `6` |  | `/// <summary>`
|  | `7` |  | `/// Specifies behavior for expected expression.`
|  | `8` |  | `/// </summary>`
|  | `9` |  | `public class ExpectAction`
|  | `10` |  | `{`
|  | `11` |  | `/// <summary>`
|  | `12` |  | `/// Gets the expected regular expression.`
|  | `13` |  | `/// </summary>`
| 15 | `14` |  | `public Regex Expect { get; private set; }`
|  | `15` |  | ``
|  | `16` |  | `/// <summary>`
|  | `17` |  | `/// Gets the action to perform when expected expression is found.`
|  | `18` |  | `/// </summary>`
| 12 | `19` |  | `public Action<string> Action { get; private set; }`
|  | `20` |  | ``
|  | `21` |  | `/// <summary>`
|  | `22` |  | `/// Initializes a new instance of the <see cref="ExpectAction"/> class.`
|  | `23` |  | `/// </summary>`
|  | `24` |  | `/// <param name="expect">The expect regular expression.</param>`
|  | `25` |  | `/// <param name="action">The action to perform.</param>`
|  | `26` |  | `/// <exception cref="ArgumentNullException"><paramref name="expect"/> or <paramref name="action"/> is <see langw`
| 3 | `27` |  | `public ExpectAction(Regex expect, Action<string> action)`
| 3 | `28` |  | `{`
| 3 | `29` |  | `if (expect is null)`
| 0 | `30` |  | `{`
| 0 | `31` |  | `throw new ArgumentNullException(nameof(expect));`
|  | `32` |  | `}`
|  | `33` |  | ``
| 3 | `34` |  | `if (action is null)`
| 0 | `35` |  | `{`
| 0 | `36` |  | `throw new ArgumentNullException(nameof(action));`
|  | `37` |  | `}`
|  | `38` |  | ``
| 3 | `39` |  | `Expect = expect;`
| 3 | `40` |  | `Action = action;`
| 3 | `41` |  | `}`
|  | `42` |  | ``
|  | `43` |  | `/// <summary>`
|  | `44` |  | `/// Initializes a new instance of the <see cref="ExpectAction"/> class.`
|  | `45` |  | `/// </summary>`
|  | `46` |  | `/// <param name="expect">The expect expression.</param>`
|  | `47` |  | `/// <param name="action">The action to perform.</param>`
|  | `48` |  | `/// <exception cref="ArgumentNullException"><paramref name="expect"/> or <paramref name="action"/> is <see langw`
| 3 | `49` |  | `public ExpectAction(string expect, Action<string> action)`
| 3 | `50` |  | `{`
| 3 | `51` |  | `if (expect is null)`
| 0 | `52` |  | `{`
| 0 | `53` |  | `throw new ArgumentNullException(nameof(expect));`
|  | `54` |  | `}`
|  | `55` |  | ``
| 3 | `56` |  | `if (action is null)`
| 0 | `57` |  | `{`
| 0 | `58` |  | `throw new ArgumentNullException(nameof(action));`
|  | `59` |  | `}`
|  | `60` |  | ``
| 3 | `61` |  | `Expect = new Regex(Regex.Escape(expect));`
| 3 | `62` |  | `Action = action;`
| 3 | `63` |  | `}`
|  | `64` |  | `}`
|  | `65` |  | `}`

# Methods/Properties

get_Expect()
get_Action()
.ctor(System.Text.RegularExpressions.Regex,System.Action`1<System.String>)
.ctor(System.String,System.Action`1<System.String>)