Open mgiuffrida opened 7 years ago
Is there a way to force Wild format during tests? Or to just not use any state that the build may have lying around?
The alternative is to ensure Standard only secrets are being checked, e.g. replace HunterSecrets.All
in the test with HunterSecrets.GetCards(true)
, but then we're only testing Standard.
It doesn't matter when you build the solution, this problem only occurs if you are in a (standard) match while running the test.
There is no need to fix this on the test level, the underlying logic needs to be separated better.
To clarify, the test failure continues after closing the Hearthstone client (and the deck tracker of course).
I actually didn't run the tests until after the first time I launched and exited my build, so I never saw these tests pass at first. I assumed they were just broken, and it wasn't until I started debugging it that I found the root of the problem.
Weird, the tests run fine for me as soon as I exit the match.
These tests assume the
Game
is in Wild format, or more accurately, is not in Standard format.SingleSecret
tests -- they pass.SingleSecret
tests -- they fail.Example failure:
Root cause: Secret tests try to verify that each Secret is possible, except for the ones that would have been triggered, e.g.:
This will fail if some state is left around that makes the test think the game is in Standard format, because while
HunterSecrets.All
includes secrets like Bear Trap,SecretHelper.GetSecretIds
will only return valid secrets in that game mode.