Skip to content

Commit 44b6b17

Browse files
committed
Tests covering some helper methods
1 parent 7bb5ad3 commit 44b6b17

File tree

1 file changed

+20
-5
lines changed

1 file changed

+20
-5
lines changed

UnitTesting/UnitTesting.cs

+20-5
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,11 @@ public void FormatSelectedCode_AllSelected()
6161

6262
HighLightSection config = configuration.GetSection("HighLightSection") as HighLightSection;
6363

64+
bool selectedTextFormated = false;
65+
addIn.GetSelectedText(Resource1.Page2, out selectedTextFormated);
6466

65-
XDocument output = addIn.InsertHighLightCode(htmlCode, pos, param, outline, config, false, false);
67+
68+
XDocument output = addIn.InsertHighLightCode(htmlCode, pos, param, outline, config, selectedTextFormated, addIn.IsSelectedTextInline(Resource1.Page2));
6669

6770
Assert.AreEqual(Resource1.Output2, output.ToString(), false);
6871
}
@@ -90,8 +93,11 @@ public void FormatSelectedCode_WordSelected()
9093

9194
HighLightSection config = configuration.GetSection("HighLightSection") as HighLightSection;
9295

96+
bool selectedTextFormated = false;
97+
addIn.GetSelectedText(Resource1.Page5, out selectedTextFormated);
9398

94-
XDocument output = addIn.InsertHighLightCode(htmlCode, pos, param, outline, config, false, true);
99+
100+
XDocument output = addIn.InsertHighLightCode(htmlCode, pos, param, outline, config, selectedTextFormated, addIn.IsSelectedTextInline(Resource1.Page5));
95101

96102
Assert.AreEqual(Resource1.Output5, output.ToString(), false);
97103
}
@@ -119,8 +125,11 @@ public void FormatSelectedCode_LineSelected()
119125

120126
HighLightSection config = configuration.GetSection("HighLightSection") as HighLightSection;
121127

128+
bool selectedTextFormated = false;
129+
addIn.GetSelectedText(Resource1.Page3, out selectedTextFormated);
122130

123-
XDocument output = addIn.InsertHighLightCode(htmlCode, pos, param, outline, config, false, false);
131+
132+
XDocument output = addIn.InsertHighLightCode(htmlCode, pos, param, outline, config, selectedTextFormated, addIn.IsSelectedTextInline(Resource1.Page3));
124133

125134
Assert.AreEqual(Resource1.Output3, output.ToString(), false);
126135
}
@@ -148,8 +157,11 @@ public void FormatSelectedCode_PartialLineSelected()
148157

149158
HighLightSection config = configuration.GetSection("HighLightSection") as HighLightSection;
150159

160+
bool selectedTextFormated = false;
161+
addIn.GetSelectedText(Resource1.Page6, out selectedTextFormated);
162+
151163

152-
XDocument output = addIn.InsertHighLightCode(htmlCode, pos, param, outline, config, false, true);
164+
XDocument output = addIn.InsertHighLightCode(htmlCode, pos, param, outline, config, selectedTextFormated, addIn.IsSelectedTextInline(Resource1.Page6));
153165

154166
Assert.AreEqual(Resource1.Output6, output.ToString(), false);
155167
}
@@ -177,8 +189,11 @@ public void EditFormattedCode_OutlineSelected()
177189

178190
HighLightSection config = configuration.GetSection("HighLightSection") as HighLightSection;
179191

192+
bool selectedTextFormated = false;
193+
addIn.GetSelectedText(Resource1.Page4, out selectedTextFormated);
194+
180195

181-
XDocument output = addIn.InsertHighLightCode(htmlCode, pos, param, outline, config, true, false);
196+
XDocument output = addIn.InsertHighLightCode(htmlCode, pos, param, outline, config, selectedTextFormated, addIn.IsSelectedTextInline(Resource1.Page4));
182197

183198
Assert.AreEqual(Resource1.Output4, output.ToString(), false);
184199
}

0 commit comments

Comments
 (0)