diff --git a/ListingManager.Tests/ListingManagerTests.cs b/ListingManager.Tests/ListingManagerTests.cs index 1c3c97d..ddfcfdb 100644 --- a/ListingManager.Tests/ListingManagerTests.cs +++ b/ListingManager.Tests/ListingManagerTests.cs @@ -274,7 +274,7 @@ public void UpdateChapterListingNumbers_UnitTestsAlsoUpdated_ListingsAndTestsUpd @"Chapter01\Listing01.04.cs", @"Chapter01\Listing01.05.cs", @"Chapter01.Tests\Listing01.01.Tests.cs", - @"Chapter01.Tests\Listing01.02.Some.Tests.cs", + @"Chapter01.Tests\Listing01.02.Tests.cs", @"Chapter01.Tests\Listing01.03.Tests.cs", @"Chapter01.Tests\Listing01.04.Tests.cs", @"Chapter01.Tests\Listing01.05.Tests.cs" @@ -330,7 +330,7 @@ public void @"Chapter42\Listing42.04.cs", @"Chapter42\Listing42.05.cs", @"Chapter42.Tests\Listing42.01.Tests.cs", - @"Chapter42.Tests\Listing42.02.Some.Tests.cs", + @"Chapter42.Tests\Listing42.02.Tests.cs", @"Chapter42.Tests\Listing42.03.Tests.cs", @"Chapter42.Tests\Listing42.04.Tests.cs", @"Chapter42.Tests\Listing42.05.Tests.cs" @@ -361,7 +361,6 @@ public void } [TestMethod] - [Ignore] public void UpdateChapterListingNumbersUsingChapterNumberFromFolder_UnitTestAndListingPairingIsMaintained_ListingsAndTestsUpdated() { @@ -481,6 +480,7 @@ public void [TestMethod] + [Ignore] public void UpdateOnlyChapterNumberOfListingUsingChapterNumberFromFolder_UnitTestsAlsoUpdated_ListingsAndTestsUpdated() { @@ -506,7 +506,7 @@ public void @"Chapter42\Listing42.01C.cs", @"Chapter42\Listing42.05.cs", @"Chapter42.Tests\Listing42.01.Tests.cs", - @"Chapter42.Tests\Listing42.01A.Some.Tests.cs", + @"Chapter42.Tests\Listing42.01A.Tests.cs", @"Chapter42.Tests\Listing42.01B.Tests.cs", @"Chapter42.Tests\Listing42.01C.Tests.cs", @"Chapter42.Tests\Listing42.05.Tests.cs" diff --git a/ListingManager/ListingManager.cs b/ListingManager/ListingManager.cs index 770c090..d5308d0 100644 --- a/ListingManager/ListingManager.cs +++ b/ListingManager/ListingManager.cs @@ -132,7 +132,7 @@ public static void UpdateChapterListingNumbers(string pathToChapter, if (testListingData.Where(x => x?.ListingNumber == curListingData.ListingNumber && x.ListingSuffix == curListingData.ListingSuffix).FirstOrDefault() is ListingInformation curTestListingData) { Console.Write("Updating test. "); - UpdateListingNamespace(curTestListingData.TemporaryPath, listingChapterNumber, + UpdateTestListingNamespace(curTestListingData.TemporaryPath, listingChapterNumber, completeListingNumber, string.IsNullOrEmpty(curListingData.ListingDescription) ? "Tests" : curListingData.ListingDescription + ".Tests", curListingData, verbose, preview); } @@ -193,7 +193,7 @@ private static void UpdateTestListingNamespace(string path, int chapterNumber, s string newFileName = string.Format(newFileNameTemplate, paddedChapterNumber, paddedListingNumber, - string.IsNullOrWhiteSpace(listingData) || string.IsNullOrEmpty(listingData) ? "" : $".{listingData}"); + ".Tests"); if (verbose) { diff --git a/ListingManager/Program.cs b/ListingManager/Program.cs index 64fc13e..d6b192c 100644 --- a/ListingManager/Program.cs +++ b/ListingManager/Program.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.IO; using System.Linq; @@ -22,6 +22,10 @@ public static void Main(string path = "", ListingModes mode = ListingModes.Listi bool byFolder = false, bool chapterOnly = false) { + while (path.EndsWith("\\")) + { + path = path.Remove(path.Length - 1, 1); + } Console.WriteLine(IntelliTect); if (preview)