-
Notifications
You must be signed in to change notification settings - Fork 505
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #602 from SteamRE/gameid-modshortcut
Improve GameID support for mods and shortcuts
- Loading branch information
Showing
2 changed files
with
65 additions
and
0 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
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 System; | ||
using SteamKit2; | ||
using Xunit; | ||
|
||
namespace Tests | ||
{ | ||
public class GameIDFacts | ||
{ | ||
[Fact] | ||
public void ModCRCCorrect() | ||
{ | ||
GameID gameId = new GameID(420, "Research and Development"); | ||
|
||
Assert.True(gameId.IsMod); | ||
Assert.Equal(gameId.AppID, 420u); | ||
Assert.Equal(gameId, new GameID(10210309621176861092)); | ||
|
||
GameID gameId2 = new GameID(215, "hidden"); | ||
|
||
Assert.True(gameId2.IsMod); | ||
Assert.Equal(gameId2.AppID, 215u); | ||
Assert.Equal(gameId2, new GameID(9826266959967158487)); | ||
} | ||
|
||
[Fact] | ||
public void ShortcutCRCCorrect() | ||
{ | ||
GameID gameId = new GameID("\"C:\\Program Files (x86)\\Git\\mingw64\\bin\\wintoast.exe\"", "Git for Windows"); | ||
|
||
Assert.True(gameId.IsShortcut); | ||
Assert.Equal(gameId, new GameID(12754778225939316736)); | ||
} | ||
} | ||
} |