-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PCGW 1.4.2 for real - actually fixed bulk import matching on URL enco…
…ded slugs
- Loading branch information
Showing
7 changed files
with
50 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
source/PCGamingWikiMetadata.Tests/MatchOnUrlEscapedSlugsTest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using PCGamingWikiBulkImport; | ||
using Playnite.SDK.Models; | ||
using PlayniteExtensions.Common; | ||
using PlayniteExtensions.Metadata.Common; | ||
using System.Collections.ObjectModel; | ||
using Xunit; | ||
|
||
namespace PCGamingWikiMetadata.Tests | ||
{ | ||
public class MatchOnUrlEscapedSlugsTest | ||
{ | ||
[Fact] | ||
public void NormalSlugMatchesEscapedSlug() | ||
{ | ||
var libraryGame = new Game("Vivisector") | ||
{ | ||
Links = new ObservableCollection<Link> | ||
{ | ||
new Link("PCGamingWiki", "https://www.pcgamingwiki.com/wiki/Vivisector%20-%20Beast%20Within") | ||
} | ||
}; | ||
|
||
var matchHelper = new GameMatchingHelper(new PCGamingWikiIdUtility(), 1); | ||
matchHelper.Prepare(new[] { libraryGame }, default); | ||
|
||
var slug = "Vivisector - Beast Within".TitleToSlug(); | ||
var expectedId = (ExternalDatabase.PCGamingWiki, PCGamingWikiIdUtility.SlugToId(slug)); | ||
|
||
Assert.True(matchHelper.TryGetGamesById(expectedId, out var games)); | ||
|
||
Assert.NotEmpty(games); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters