Skip to content

Commit 23b2947

Browse files
committed
Change some variable names
Instead of using FQNWithNS we use FQNWithoutNS and FQN. This makes more logical sense since a FQN is supposed to contain a NS anyways.
1 parent d580a6a commit 23b2947

18 files changed

Lines changed: 70 additions & 70 deletions

GoogleTestAdapter/Core.Tests/GoogleTestDiscovererTests.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ public void GetTestsFromExecutable_DoNotParseSymbolInformation_DiaIsNotInvoked()
283283
testCase.LineNumber.Should().Be(0);
284284
testCase.Source.Should().Be(TestResources.Tests_DebugX86);
285285
testCase.DisplayName.Should().NotBeNullOrEmpty();
286-
testCase.FullyQualifiedName.Should().NotBeNullOrEmpty();
286+
testCase.FullyQualifiedNameWithoutNamespace.Should().NotBeNullOrEmpty();
287287
}
288288
}
289289

@@ -309,8 +309,8 @@ public void DiscoverTests_TestDiscoveryParam_TestsFoundWithAdditionalDiscoveryPa
309309
discoverer.DiscoverTests(TestResources.TestDiscoveryParamExe.Yield(), MockFrameworkReporter.Object);
310310

311311
testCases.Count.Should().Be(2);
312-
testCases.Should().Contain(t => t.FullyQualifiedName == "TestDiscovery.TestFails");
313-
testCases.Should().Contain(t => t.FullyQualifiedName == "TestDiscovery.TestPasses");
312+
testCases.Should().Contain(t => t.FullyQualifiedNameWithoutNamespace == "TestDiscovery.TestFails");
313+
testCases.Should().Contain(t => t.FullyQualifiedNameWithoutNamespace == "TestDiscovery.TestPasses");
314314
}
315315

316316
[TestMethod]
@@ -323,8 +323,8 @@ public void GetTestsFromExecubable_TestDiscoveryParam_TestsFoundWithAdditionalDi
323323
IList<TestCase> testCases = discoverer.GetTestsFromExecutable(TestResources.TestDiscoveryParamExe);
324324

325325
testCases.Count.Should().Be(2);
326-
testCases.Should().Contain(t => t.FullyQualifiedName == "TestDiscovery.TestFails");
327-
testCases.Should().Contain(t => t.FullyQualifiedName == "TestDiscovery.TestPasses");
326+
testCases.Should().Contain(t => t.FullyQualifiedNameWithoutNamespace == "TestDiscovery.TestFails");
327+
testCases.Should().Contain(t => t.FullyQualifiedNameWithoutNamespace == "TestDiscovery.TestPasses");
328328
}
329329

330330
[TestMethod]
@@ -338,7 +338,7 @@ public void GetTestsFromExecutable_LoadTests_AllTestsAreFound()
338338
for (int i = 0; i < 5000; i++)
339339
{
340340
string fullyQualifiedName = $"LoadTests.Test/{i}";
341-
bool contains = testCases.Any(tc => tc.FullyQualifiedName == fullyQualifiedName);
341+
bool contains = testCases.Any(tc => tc.FullyQualifiedNameWithoutNamespace == fullyQualifiedName);
342342
contains.Should().BeTrue($" Test not found: {fullyQualifiedName}");
343343
}
344344
}
@@ -374,12 +374,12 @@ private void FindTests(string location)
374374

375375
testCases.Count.Should().Be(TestResources.NrOfTests);
376376

377-
TestCase testCase = testCases.Single(tc => tc.FullyQualifiedName == "TheFixture.AddFails");
377+
TestCase testCase = testCases.Single(tc => tc.FullyQualifiedNameWithoutNamespace == "TheFixture.AddFails");
378378
testCase.DisplayName.Should().Be("TheFixture.AddFails");
379379
testCase.CodeFilePath.Should().EndWith(@"sampletests\tests\fixturetests.cpp");
380380
testCase.LineNumber.Should().Be(11);
381381

382-
testCase = testCases.Single(tc => tc.FullyQualifiedName == "Arr/TypeParameterizedTests/1.CanDefeatMath");
382+
testCase = testCases.Single(tc => tc.FullyQualifiedNameWithoutNamespace == "Arr/TypeParameterizedTests/1.CanDefeatMath");
383383
testCase.DisplayName.Should().Be("Arr/TypeParameterizedTests/1.CanDefeatMath<MyStrangeArray>");
384384
testCase.CodeFilePath.Should().EndWith(@"sampletests\tests\typeparameterizedtests.cpp");
385385
testCase.LineNumber.Should().Be(53);
@@ -416,7 +416,7 @@ private void AssertFindsTest(string fullyQualifiedName, Regex displayNameRegex)
416416
var discoverer = new GoogleTestDiscoverer(TestEnvironment.Logger, TestEnvironment.Options);
417417
IList<TestCase> tests = discoverer.GetTestsFromExecutable(TestResources.Tests_DebugX86);
418418

419-
TestCase testCase = tests.Single(t => t.FullyQualifiedName == fullyQualifiedName);
419+
TestCase testCase = tests.Single(t => t.FullyQualifiedNameWithoutNamespace == fullyQualifiedName);
420420
testCase.DisplayName.Should().MatchRegex(displayNameRegex.ToString());
421421
}
422422

GoogleTestAdapter/Core.Tests/Scheduling/DurationBasedTestsSplitterTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public void SplitTestcases_SimpleCase_TestsAreDistributedCorrectly()
2828

2929
result.Count.Should().Be(2);
3030
result[0].Count.Should().Be(1);
31-
result[0][0].FullyQualifiedName.Should().Be("LongTest");
31+
result[0][0].FullyQualifiedNameWithoutNamespace.Should().Be("LongTest");
3232
result[1].Count.Should().Be(3);
3333
}
3434

@@ -49,7 +49,7 @@ public void SplitTestcases_SimpleCaseWithThreeThreads_TestsAreDistributedCorrect
4949

5050
result.Count.Should().Be(3);
5151
result[0].Count.Should().Be(1);
52-
result[0][0].FullyQualifiedName.Should().Be("LongTest");
52+
result[0][0].FullyQualifiedNameWithoutNamespace.Should().Be("LongTest");
5353
result[1].Count.Should().Be(2);
5454
result[2].Count.Should().Be(1);
5555
}
@@ -69,7 +69,7 @@ public void SplitTestcases_AsymmetricCase_TestsAreDistributedCorrectly()
6969

7070
result.Count.Should().Be(2);
7171
result[0].Count.Should().Be(1);
72-
result[0][0].FullyQualifiedName.Should().Be("LongTest");
72+
result[0][0].FullyQualifiedNameWithoutNamespace.Should().Be("LongTest");
7373
result[1].Count.Should().Be(1);
7474
}
7575

GoogleTestAdapter/Core.Tests/TestCases/TestCaseFactoryTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ public void CreateTestCases_AdditionalTestDiscoveryParam_TestDiscoveryUsesAdditi
4848
var returnedTestCases = factory.CreateTestCases(testCase => reportedTestCases.Add(testCase));
4949

5050
reportedTestCases.Count.Should().Be(2);
51-
reportedTestCases.Should().Contain(t => t.FullyQualifiedName == "TestDiscovery.TestFails");
52-
reportedTestCases.Should().Contain(t => t.FullyQualifiedName == "TestDiscovery.TestPasses");
51+
reportedTestCases.Should().Contain(t => t.FullyQualifiedNameWithoutNamespace == "TestDiscovery.TestFails");
52+
reportedTestCases.Should().Contain(t => t.FullyQualifiedNameWithoutNamespace == "TestDiscovery.TestPasses");
5353
}
5454

5555
}

GoogleTestAdapter/Core.Tests/TestResults/StandardOutputTestResultParserTests.cs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -143,19 +143,19 @@ public void GetTestResults_CompleteOutput_ParsedCorrectly()
143143

144144
results.Count.Should().Be(3);
145145

146-
results[0].TestCase.FullyQualifiedName.Should().Be("TestMath.AddFails");
146+
results[0].TestCase.FullyQualifiedNameWithoutNamespace.Should().Be("TestMath.AddFails");
147147
XmlTestResultParserTests.AssertTestResultIsFailure(results[0]);
148148
results[0].ErrorMessage.Should().NotContain(StandardOutputTestResultParser.CrashText);
149149
results[0].Duration.Should().Be(TimeSpan.FromMilliseconds(3));
150150
results[0].ErrorStackTrace.Should()
151151
.Contain(
152152
@"c:\users\chris\documents\visual studio 2015\projects\consoleapplication1\consoleapplication1tests\source.cpp");
153153

154-
results[1].TestCase.FullyQualifiedName.Should().Be("TestMath.AddPasses");
154+
results[1].TestCase.FullyQualifiedNameWithoutNamespace.Should().Be("TestMath.AddPasses");
155155
XmlTestResultParserTests.AssertTestResultIsPassed(results[1]);
156156
results[1].Duration.Should().Be(StandardOutputTestResultParser.ShortTestDuration);
157157

158-
results[2].TestCase.FullyQualifiedName.Should().Be("TestMath.Crash");
158+
results[2].TestCase.FullyQualifiedNameWithoutNamespace.Should().Be("TestMath.Crash");
159159
XmlTestResultParserTests.AssertTestResultIsFailure(results[2]);
160160
results[2].ErrorMessage.Should().NotContain(StandardOutputTestResultParser.CrashText);
161161
results[2].Duration.Should().Be(TimeSpan.FromMilliseconds(9));
@@ -169,13 +169,13 @@ public void GetTestResults_OutputWithImmediateCrash_CorrectResultHasCrashText()
169169

170170
results.Count.Should().Be(2);
171171

172-
results[0].TestCase.FullyQualifiedName.Should().Be("TestMath.AddFails");
172+
results[0].TestCase.FullyQualifiedNameWithoutNamespace.Should().Be("TestMath.AddFails");
173173
XmlTestResultParserTests.AssertTestResultIsFailure(results[0]);
174174
results[0].ErrorMessage.Should().NotContain(StandardOutputTestResultParser.CrashText);
175175
results[0].Duration.Should().Be(TimeSpan.FromMilliseconds(3));
176176
results[0].ErrorStackTrace.Should().Contain(@"c:\users\chris\documents\visual studio 2015\projects\consoleapplication1\consoleapplication1tests\source.cpp");
177177

178-
results[1].TestCase.FullyQualifiedName.Should().Be("TestMath.AddPasses");
178+
results[1].TestCase.FullyQualifiedNameWithoutNamespace.Should().Be("TestMath.AddPasses");
179179
XmlTestResultParserTests.AssertTestResultIsFailure(results[1]);
180180
results[1].ErrorMessage.Should().Contain(StandardOutputTestResultParser.CrashText);
181181
results[1].ErrorMessage.Should().NotContain("Test output:");
@@ -190,17 +190,17 @@ public void GetTestResults_OutputWithCrashAfterErrorMessage_CorrectResultHasCras
190190

191191
results.Count.Should().Be(3);
192192

193-
results[0].TestCase.FullyQualifiedName.Should().Be("TestMath.AddFails");
193+
results[0].TestCase.FullyQualifiedNameWithoutNamespace.Should().Be("TestMath.AddFails");
194194
XmlTestResultParserTests.AssertTestResultIsFailure(results[0]);
195195
results[0].ErrorMessage.Should().NotContain(StandardOutputTestResultParser.CrashText);
196196
results[0].Duration.Should().Be(TimeSpan.FromMilliseconds(3));
197197
results[0].ErrorStackTrace.Should().Contain(@"c:\users\chris\documents\visual studio 2015\projects\consoleapplication1\consoleapplication1tests\source.cpp");
198198

199-
results[1].TestCase.FullyQualifiedName.Should().Be("TestMath.AddPasses");
199+
results[1].TestCase.FullyQualifiedNameWithoutNamespace.Should().Be("TestMath.AddPasses");
200200
XmlTestResultParserTests.AssertTestResultIsPassed(results[1]);
201201
results[1].Duration.Should().Be(StandardOutputTestResultParser.ShortTestDuration);
202202

203-
results[2].TestCase.FullyQualifiedName.Should().Be("TestMath.Crash");
203+
results[2].TestCase.FullyQualifiedNameWithoutNamespace.Should().Be("TestMath.Crash");
204204
XmlTestResultParserTests.AssertTestResultIsFailure(results[2]);
205205
results[2].ErrorMessage.Should().Contain(StandardOutputTestResultParser.CrashText);
206206
results[2].ErrorMessage.Should().Contain("Test output:");
@@ -215,7 +215,7 @@ public void GetTestResults_OutputWithInvalidDurationUnit_DefaultDurationIsUsedAn
215215
List<TestResult> results = ComputeTestResults(WrongDurationUnit);
216216

217217
results.Count.Should().Be(1);
218-
results[0].TestCase.FullyQualifiedName.Should().Be("TestMath.AddFails");
218+
results[0].TestCase.FullyQualifiedNameWithoutNamespace.Should().Be("TestMath.AddFails");
219219
results[0].Duration.Should().Be(TimeSpan.FromMilliseconds(1));
220220
results[0].ErrorStackTrace.Should().Contain(@"c:\users\chris\documents\visual studio 2015\projects\consoleapplication1\consoleapplication1tests\source.cpp");
221221

@@ -234,7 +234,7 @@ public void GetTestResults_OutputWithThousandsSeparatorInDuration_ParsedCorrectl
234234
List<TestResult> results = ComputeTestResults(ThousandsSeparatorInDuration);
235235

236236
results.Count.Should().Be(1);
237-
results[0].TestCase.FullyQualifiedName.Should().Be("TestMath.AddFails");
237+
results[0].TestCase.FullyQualifiedNameWithoutNamespace.Should().Be("TestMath.AddFails");
238238
results[0].Duration.Should().Be(TimeSpan.FromMilliseconds(4656));
239239
}
240240
finally
@@ -250,7 +250,7 @@ public void GetTestResults_OutputWithConsoleOutput_ConsoleOutputIsIgnored()
250250
List<TestResult> results = ComputeTestResults(PassingTestProducesConsoleOutput);
251251

252252
results.Count.Should().Be(1);
253-
results[0].TestCase.FullyQualifiedName.Should().Be("TestMath.AddPasses");
253+
results[0].TestCase.FullyQualifiedNameWithoutNamespace.Should().Be("TestMath.AddPasses");
254254
XmlTestResultParserTests.AssertTestResultIsPassed(results[0]);
255255
}
256256

@@ -270,9 +270,9 @@ public void GetTestResults_OutputWithPrefixingTest_BothTestsAreFound()
270270
.GetTestResults();
271271

272272
results.Count.Should().Be(2);
273-
results[0].TestCase.FullyQualifiedName.Should().Be("Test.AB");
273+
results[0].TestCase.FullyQualifiedNameWithoutNamespace.Should().Be("Test.AB");
274274
XmlTestResultParserTests.AssertTestResultIsPassed(results[0]);
275-
results[1].TestCase.FullyQualifiedName.Should().Be("Test.A");
275+
results[1].TestCase.FullyQualifiedNameWithoutNamespace.Should().Be("Test.A");
276276
XmlTestResultParserTests.AssertTestResultIsPassed(results[1]);
277277
}
278278

0 commit comments

Comments
 (0)