Open Fuco1 opened 7 years ago
We actually have tests already using gtest (not sure if you saw em, they're in the test/ top level directory). Feel free to add in this if you have a test you want to use it for.
I saw them, but gtest doesn't seem to support mocking, without which the system components can hardly be tested, the dependencies are too far-reaching.
For example, how would I instantiate a FAWorld::Monster
in a test? I would need to also get the monster instance from the exe, which seems irrelevant for many purposes (like testing if A can attack B or if a monster can move to a given square).
I will have to read some more on C++ testing practices.
https://github.com/eranpeer/FakeIt
Unfortunately my CMake-fu is very low so I have no idea how to pull this into the project. But I wanted to write some tests now just for fun (for the faction PR) and figured C++ tests are unlike anything I've ever worked with :D So yea... /shrug