I'm currently in the process of trying to find uses for RequestTestBase (https://github.com/kolmafia/kolmafia/pull/175) (while waiting for progress on the language server side).
One thing that I'm realizing is that it was probably a bad idea to simply have *respondIf* take a mere String as the first parameter; we'll want to submit well formed replicas of what KoL submits, and it'd be a pain to have to re-form everything every time...
So, I'm thinking of making a library that would help with creating these mock KoL responses.
It would be an exhaustive tree of classes. What I have currently:
(abstract) FakeKoLResponse
--- FakeApiResponse (maybe?)
--- FakeCharPaneResponse
--- (abstract) FakeMainPaneResponse
------ (abstract) FakeActionResponse (final name TBD. This is the two situations that have the "action bar" at the top)
--------- FakeChoiceResponse
--------- FakeFightResponse
------ FakeInventoryResponse
1- how does the concept sound?
2- Any important category of response I'm forgetting?
One thing that I'm realizing is that it was probably a bad idea to simply have *respondIf* take a mere String as the first parameter; we'll want to submit well formed replicas of what KoL submits, and it'd be a pain to have to re-form everything every time...
So, I'm thinking of making a library that would help with creating these mock KoL responses.
It would be an exhaustive tree of classes. What I have currently:
(abstract) FakeKoLResponse
--- FakeApiResponse (maybe?)
--- FakeCharPaneResponse
--- (abstract) FakeMainPaneResponse
------ (abstract) FakeActionResponse (final name TBD. This is the two situations that have the "action bar" at the top)
--------- FakeChoiceResponse
--------- FakeFightResponse
------ FakeInventoryResponse
1- how does the concept sound?
2- Any important category of response I'm forgetting?