forked from HearthSim/Hearthstone-Deck-Tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
95 changed files
with
27,381 additions
and
150 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 was deleted.
Oops, something went wrong.
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,73 @@ | ||
using System.Drawing; | ||
using Hearthstone_Deck_Tracker.Utility; | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
|
||
namespace HDTTests.RankedDetection | ||
{ | ||
[TestClass] | ||
public class RankedDetectionMenuTest | ||
{ | ||
// Test all menus fail (due to how legend detect works) | ||
|
||
[TestMethod] | ||
public void AllMenus_16_9() // at 16:9 area is same for all menus | ||
{ | ||
Assert.IsTrue(MenuFails("16-9_Menus")); | ||
} | ||
|
||
[TestMethod] | ||
public void AiMenu() | ||
{ | ||
Assert.IsTrue(MenuFails("AiMenu")); | ||
} | ||
|
||
[TestMethod] | ||
public void ArenaMenu() | ||
{ | ||
Assert.IsTrue(MenuFails("Arena")); | ||
} | ||
|
||
[TestMethod] | ||
public void BrawlMenu() | ||
{ | ||
Assert.IsTrue(MenuFails("Brawl")); | ||
} | ||
|
||
[TestMethod] | ||
public void CollectionMenu() | ||
{ | ||
Assert.IsTrue(MenuFails("Collection")); | ||
} | ||
|
||
[TestMethod] | ||
public void PlayMenu() | ||
{ | ||
Assert.IsTrue(MenuFails("PlayMenu")); | ||
} | ||
|
||
[TestMethod] | ||
public void MainMenu_16_9() | ||
{ | ||
Assert.IsTrue(MenuFails("MainMenu_16-9")); | ||
} | ||
|
||
[TestMethod] | ||
public void MainMenu_4_3() | ||
{ | ||
Assert.IsTrue(MenuFails("MainMenu_4-3")); | ||
} | ||
|
||
// Helper methods | ||
|
||
private bool MenuFails(string name) | ||
{ | ||
var testFiles = "RankedDetection/TestFiles/"; | ||
var bmp = new Bitmap(testFiles + name + "_Opp.png"); | ||
var opp = RankDetection.FindBest(bmp); | ||
bmp = new Bitmap(testFiles + name + "_Play.png"); | ||
var play = RankDetection.FindBest(bmp); | ||
|
||
return opp == -1 && play == -1; | ||
} | ||
} | ||
} |
Oops, something went wrong.