Skip to content

Commit

Permalink
Change test naming and allow '\' at end of path (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
BenjaminMichaelis authored Oct 19, 2022
1 parent e09649b commit ab844e3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
8 changes: 4 additions & 4 deletions ListingManager.Tests/ListingManagerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -361,7 +361,6 @@ public void
}

[TestMethod]
[Ignore]
public void
UpdateChapterListingNumbersUsingChapterNumberFromFolder_UnitTestAndListingPairingIsMaintained_ListingsAndTestsUpdated()
{
Expand Down Expand Up @@ -481,6 +480,7 @@ public void


[TestMethod]
[Ignore]
public void
UpdateOnlyChapterNumberOfListingUsingChapterNumberFromFolder_UnitTestsAlsoUpdated_ListingsAndTestsUpdated()
{
Expand All @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions ListingManager/ListingManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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)
{
Expand Down
6 changes: 5 additions & 1 deletion ListingManager/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.IO;
using System.Linq;

Expand All @@ -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)
Expand Down

0 comments on commit ab844e3

Please sign in to comment.