Skip to content

Commit 10bcbdc

Browse files
author
Kapil Borle
committed
Add Description property to CorrectionExtent class
1 parent afccf35 commit 10bcbdc

2 files changed

Lines changed: 40 additions & 2 deletions

File tree

Engine/Generic/CorrectionExtent.cs

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,24 +58,61 @@ public string Text
5858
}
5959
}
6060

61+
public string Description
62+
{
63+
get
64+
{
65+
return description;
66+
}
67+
}
68+
6169
private string file;
6270
private int startLineNumber;
6371
private int endLineNumber;
6472
private int startColumnNumber;
6573
private int endColumnNumber;
6674
private string text;
75+
private string description;
6776

68-
public CorrectionExtent(int startLineNumber, int endLineNumber, int startColumnNumber, int endColumnNumber, string text, string file)
77+
public CorrectionExtent(
78+
int startLineNumber,
79+
int endLineNumber,
80+
int startColumnNumber,
81+
int endColumnNumber,
82+
string text,
83+
string file)
84+
: this(
85+
startLineNumber,
86+
endLineNumber,
87+
startColumnNumber,
88+
endColumnNumber,
89+
text,
90+
file,
91+
null)
92+
{
93+
}
94+
95+
public CorrectionExtent(
96+
int startLineNumber,
97+
int endLineNumber,
98+
int startColumnNumber,
99+
int endColumnNumber,
100+
string text,
101+
string file,
102+
string description)
69103
{
70104
this.startLineNumber = startLineNumber;
71105
this.endLineNumber = endLineNumber;
72106
this.startColumnNumber = startColumnNumber;
73107
this.endColumnNumber = endColumnNumber;
74108
this.file = file;
75109
this.text = text;
110+
this.description = description;
76111
ThrowIfInvalidArguments();
77112
}
78113

114+
115+
79116
private void ThrowIfInvalidArguments()
80117
{
81118
ThrowIfNull<string>(file, "filename");

Tests/Engine/CorrectionExtent.tests.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,15 @@ Describe "Correction Extent" {
88

99
Context "Object construction" {
1010
It "creates the object with correct properties" {
11-
$correctionExtent = $type::new(1, 1, 1, 3, "get-childitem", "newfile")
11+
$correctionExtent = $type::new(1, 1, 1, 3, "get-childitem", "newfile", "cool description")
1212

1313
$correctionExtent.StartLineNumber | Should Be 1
1414
$correctionExtent.EndLineNumber | Should Be 1
1515
$correctionExtent.StartColumnNumber | Should Be 1
1616
$correctionExtent.EndColumnNumber | Should be 3
1717
$correctionExtent.Text | Should Be "get-childitem"
1818
$correctionExtent.File | Should Be "newfile"
19+
$correctionExtent.Description | Should Be "cool description"
1920
}
2021

2122
It "throws if end line number is less than start line number" {

0 commit comments

Comments
 (0)