Skip to content

Commit 61428af

Browse files
committed
Use explicit type rather than var
1 parent a92dae8 commit 61428af

14 files changed

+579
-416
lines changed

tests/SIL.Machine.Tests/Corpora/FallbackQuotationMarkResolverTests.cs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ public class FallbackQuotationMarkResolverTests
99
[Test]
1010
public void Reset()
1111
{
12-
var englishQuoteConvention = QuoteConventions.Standard.GetQuoteConventionByName("standard_english");
12+
QuoteConvention englishQuoteConvention = QuoteConventions.Standard.GetQuoteConventionByName("standard_english");
1313
Assert.IsNotNull(englishQuoteConvention);
1414

1515
var basicQuotationMarkResolver = new FallbackQuotationMarkResolver(
@@ -34,7 +34,7 @@ public void Reset()
3434
[Test]
3535
public void SimpleQuotationMarkResolutionWithNoPreviousMark()
3636
{
37-
var englishQuoteConvention = QuoteConventions.Standard.GetQuoteConventionByName("standard_english");
37+
QuoteConvention englishQuoteConvention = QuoteConventions.Standard.GetQuoteConventionByName("standard_english");
3838
Assert.IsNotNull(englishQuoteConvention);
3939

4040
var basicQuotationMarkResolver = new FallbackQuotationMarkResolver(
@@ -64,7 +64,7 @@ [new QuotationMarkStringMatch(new TextSegment.Builder().SetText("test \" text").
6464
[Test]
6565
public void SimpleQuotationMarkResolutionWithPreviousOpeningMark()
6666
{
67-
var englishQuoteConvention = QuoteConventions.Standard.GetQuoteConventionByName("standard_english");
67+
QuoteConvention englishQuoteConvention = QuoteConventions.Standard.GetQuoteConventionByName("standard_english");
6868
Assert.IsNotNull(englishQuoteConvention);
6969

7070
var basicQuotationMarkResolver = new FallbackQuotationMarkResolver(
@@ -105,7 +105,7 @@ public void SimpleQuotationMarkResolutionWithPreviousOpeningMark()
105105
[Test]
106106
public void SimpleQuotationMarkResolutionWithPreviousClosingMark()
107107
{
108-
var englishQuoteConvention = QuoteConventions.Standard.GetQuoteConventionByName("standard_english");
108+
QuoteConvention englishQuoteConvention = QuoteConventions.Standard.GetQuoteConventionByName("standard_english");
109109
Assert.IsNotNull(englishQuoteConvention);
110110

111111
var basicQuotationMarkResolver = new FallbackQuotationMarkResolver(
@@ -146,7 +146,7 @@ public void SimpleQuotationMarkResolutionWithPreviousClosingMark()
146146
[Test]
147147
public void IsOpeningQuote()
148148
{
149-
var englishQuoteConvention = QuoteConventions.Standard.GetQuoteConventionByName("standard_english");
149+
QuoteConvention englishQuoteConvention = QuoteConventions.Standard.GetQuoteConventionByName("standard_english");
150150
Assert.IsNotNull(englishQuoteConvention);
151151

152152
var basicQuotationMarkResolver = new FallbackQuotationMarkResolver(
@@ -189,7 +189,7 @@ public void IsOpeningQuote()
189189
[Test]
190190
public void IsOpeningQuoteWithUnambiguousQuoteConvention()
191191
{
192-
var englishQuoteConvention = QuoteConventions.Standard.GetQuoteConventionByName("standard_english");
192+
QuoteConvention englishQuoteConvention = QuoteConventions.Standard.GetQuoteConventionByName("standard_english");
193193
Assert.IsNotNull(englishQuoteConvention);
194194

195195
var basicQuotationMarkResolver = new FallbackQuotationMarkResolver(
@@ -216,7 +216,7 @@ public void IsOpeningQuoteWithUnambiguousQuoteConvention()
216216
[Test]
217217
public void IsOpeningQuoteStateful()
218218
{
219-
var englishQuoteConvention = QuoteConventions.Standard.GetQuoteConventionByName("standard_english");
219+
QuoteConvention englishQuoteConvention = QuoteConventions.Standard.GetQuoteConventionByName("standard_english");
220220
Assert.IsNotNull(englishQuoteConvention);
221221

222222
var basicQuotationMarkResolver = new FallbackQuotationMarkResolver(
@@ -246,7 +246,7 @@ public void IsOpeningQuoteStateful()
246246
[Test]
247247
public void DoesMostRecentOpeningMarkImmediatelyPrecede()
248248
{
249-
var englishQuoteConvention = QuoteConventions.Standard.GetQuoteConventionByName("standard_english");
249+
QuoteConvention englishQuoteConvention = QuoteConventions.Standard.GetQuoteConventionByName("standard_english");
250250
Assert.IsNotNull(englishQuoteConvention);
251251

252252
var basicQuotationMarkResolver = new FallbackQuotationMarkResolver(
@@ -314,7 +314,7 @@ public void DoesMostRecentOpeningMarkImmediatelyPrecede()
314314
[Test]
315315
public void IsClosingQuote()
316316
{
317-
var englishQuoteConvention = QuoteConventions.Standard.GetQuoteConventionByName("standard_english");
317+
QuoteConvention englishQuoteConvention = QuoteConventions.Standard.GetQuoteConventionByName("standard_english");
318318
Assert.IsNotNull(englishQuoteConvention);
319319

320320
var basicQuotationMarkResolver = new FallbackQuotationMarkResolver(
@@ -361,7 +361,7 @@ public void IsClosingQuote()
361361
[Test]
362362
public void IsClosingQuoteWithUnambiguousQuoteConvention()
363363
{
364-
var englishQuoteConvention = QuoteConventions.Standard.GetQuoteConventionByName("standard_english");
364+
QuoteConvention englishQuoteConvention = QuoteConventions.Standard.GetQuoteConventionByName("standard_english");
365365
Assert.IsNotNull(englishQuoteConvention);
366366

367367
var basicQuotationMarkResolver = new FallbackQuotationMarkResolver(
@@ -388,7 +388,7 @@ public void IsClosingQuoteWithUnambiguousQuoteConvention()
388388
[Test]
389389
public void ResolveOpeningQuote()
390390
{
391-
var englishQuoteConvention = QuoteConventions.Standard.GetQuoteConventionByName("standard_english");
391+
QuoteConvention englishQuoteConvention = QuoteConventions.Standard.GetQuoteConventionByName("standard_english");
392392
Assert.IsNotNull(englishQuoteConvention);
393393

394394
var basicQuotationMarkResolver = new FallbackQuotationMarkResolver(
@@ -403,7 +403,7 @@ public void ResolveOpeningQuote()
403403
0,
404404
1
405405
);
406-
var actualResolvedQuotationMark = basicQuotationMarkResolver.ResolveOpeningMark(
406+
QuotationMarkMetadata actualResolvedQuotationMark = basicQuotationMarkResolver.ResolveOpeningMark(
407407
new QuotationMarkStringMatch(new TextSegment.Builder().SetText("\"test text\"").Build(), 0, 1)
408408
);
409409
Assert.That(actualResolvedQuotationMark, Is.EqualTo(expectedResolvedQuotationMark));
@@ -413,7 +413,7 @@ public void ResolveOpeningQuote()
413413
[Test]
414414
public void ResolveClosingQuote()
415415
{
416-
var englishQuoteConvention = QuoteConventions.Standard.GetQuoteConventionByName("standard_english");
416+
QuoteConvention englishQuoteConvention = QuoteConventions.Standard.GetQuoteConventionByName("standard_english");
417417
Assert.IsNotNull(englishQuoteConvention);
418418

419419
var basicQuotationMarkResolver = new FallbackQuotationMarkResolver(
@@ -428,7 +428,7 @@ public void ResolveClosingQuote()
428428
10,
429429
11
430430
);
431-
var actualResolvedQuotationMark = basicQuotationMarkResolver.ResolveClosingMark(
431+
QuotationMarkMetadata actualResolvedQuotationMark = basicQuotationMarkResolver.ResolveClosingMark(
432432
new QuotationMarkStringMatch(new TextSegment.Builder().SetText("\"test text\"").Build(), 10, 11)
433433
);
434434
Assert.That(actualResolvedQuotationMark, Is.EqualTo(expectedResolvedQuotationMark));

tests/SIL.Machine.Tests/Corpora/QuotationDenormalizationTests.cs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ public class QuotationDenormalizationTests
99
[Test]
1010
public void FullQuotationDenormalizationPipeline()
1111
{
12-
var normalizedUsfm =
12+
string normalizedUsfm =
1313
@"
1414
\id GEN
1515
\c 1
@@ -23,15 +23,17 @@ of the field which Yahweh God had made.
2323
God has said, 'You shall not eat of it. You shall not touch it, lest you die.'""
2424
";
2525

26-
var expectedDenormalizedUsfm =
26+
string expectedDenormalizedUsfm =
2727
@"\id GEN
2828
\c 1
2929
\v 1 Now the serpent was more subtle than any animal of the field which Yahweh God had made. He said to the woman, “Has God really said, ‘You shall not eat of any tree of the garden’?”
3030
\v 2 The woman said to the serpent, “We may eat fruit from the trees of the garden,
3131
\v 3 but not the fruit of the tree which is in the middle of the garden. God has said, ‘You shall not eat of it. You shall not touch it, lest you die.’”
3232
";
3333

34-
var standardEnglishQuoteConvention = QuoteConventions.Standard.GetQuoteConventionByName("standard_english");
34+
QuoteConvention standardEnglishQuoteConvention = QuoteConventions.Standard.GetQuoteConventionByName(
35+
"standard_english"
36+
);
3537
Assert.IsNotNull(standardEnglishQuoteConvention);
3638

3739
var quotationMarkDenormalizationFirstPass = new QuotationMarkDenormalizationFirstPass(
@@ -40,7 +42,8 @@ of the field which Yahweh God had made.
4042
);
4143

4244
UsfmParser.Parse(normalizedUsfm, quotationMarkDenormalizationFirstPass);
43-
var bestChapterStrategies = quotationMarkDenormalizationFirstPass.FindBestChapterStrategies();
45+
List<QuotationMarkUpdateStrategy> bestChapterStrategies =
46+
quotationMarkDenormalizationFirstPass.FindBestChapterStrategies();
4447

4548
var quotationMarkDenormalizer = new QuotationMarkDenormalizationUsfmUpdateBlockHandler(
4649
standardEnglishQuoteConvention,
@@ -51,7 +54,7 @@ of the field which Yahweh God had made.
5154
var updater = new UpdateUsfmParserHandler(updateBlockHandlers: [quotationMarkDenormalizer]);
5255
UsfmParser.Parse(normalizedUsfm, updater);
5356

54-
var actualDenormalizedUsfm = updater.GetUsfm();
57+
string actualDenormalizedUsfm = updater.GetUsfm();
5558

5659
Assert.That(actualDenormalizedUsfm, Is.EqualTo(expectedDenormalizedUsfm).IgnoreLineEndings());
5760
}

0 commit comments

Comments
 (0)