Fix Chapter 14 failing unit tests
- File count has changed for these tests
- Fix to use Path.DirectorySeparatorChar instead of hard coded \
MODIFY
src/Chapter14.Tests/Listing14.15.ProjectionWithSystem.Linq.Enumerable.Select.Tests.cs
src/Chapter14.Tests/Listing14.15.ProjectionWithSystem.Linq.Enumerable.Select.Tests.cs
@@ -12,7 +12,7 @@ namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter14.Listing14_15.Tests
[TestMethod]
public void Listing14_15_Test()
{
- string expectedPattern = $@"{ Directory.GetCurrentDirectory() }\*";
+ string expectedPattern = $@"{ Directory.GetCurrentDirectory() }{Path.DirectorySeparatorChar}*";
string output = IntelliTect.TestTools.Console.ConsoleAssert.Execute(null, () =>
{
@@ -21,7 +21,7 @@ namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter14.Listing14_15.Tests
IEnumerable<string> outputItems = output.Split('\n');
- Assert.AreEqual(10, outputItems.Count());
+ Assert.AreEqual(6, outputItems.Count());
foreach (string item in outputItems)
{
Assert.IsTrue(item.IsLike(expectedPattern));

MODIFY
src/Chapter14.Tests/Listing14.16.ProjectionToAnAnonymousType.Tests.cs
src/Chapter14.Tests/Listing14.16.ProjectionToAnAnonymousType.Tests.cs
@@ -20,7 +20,7 @@ namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter14.Listing14_16.Tests
IEnumerable<string> outputItems = output.Split('\n');
- Assert.AreEqual(10, outputItems.Count());
+ Assert.AreEqual(6, outputItems.Count());
foreach (string item in outputItems)
{
Assert.IsTrue(item.IsLike(expectedPattern));

MODIFY
src/Chapter14.Tests/Listing14.17.ExecutingLinqQueriesInParallel.Tests.cs
src/Chapter14.Tests/Listing14.17.ExecutingLinqQueriesInParallel.Tests.cs
@@ -21,7 +21,7 @@ namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter14.Listing14_17.Tests
IEnumerable<string> outputItems = output.Split('\n');
- Assert.AreEqual(10, outputItems.Count());
+ Assert.AreEqual(6, outputItems.Count());
foreach (string item in outputItems)
{
Assert.IsTrue(item.IsLike(expectedPattern));

Fix Chapter 14 failing unit tests
  - File count has changed for these tests
  - Fix to use Path.DirectorySeparatorChar instead of hard coded \