richelbilderbeek / djog_unos_2018

Project by the Uno's at DJOG 2018-2019: Nature Zen
GNU General Public License v3.0
6 stars 2 forks source link

More expressive tests for 'can_eat' #358

Closed richelbilderbeek closed 5 years ago

richelbilderbeek commented 5 years ago

Is your feature request related to a problem? Please describe.

Currently, can_eat is tested as such:

  // Test can_eat
  {
    for (agent_type a : collect_all_agent_types()) {
      can_eat(a);
    }
  }

It tests that can_eat 'does something'.

It would be superior if it actually tests the food web.

Describe the solution you'd like

Replace the test by a multiple simple food web tests:

Something like this:

assert(can_eat(agent::cow) == { agent::grass} ); //Will not compile!

Yup, this will not compile, as one cannot use { and } in an assert, so you'll have to find a better way yourself.

Test for the whole implented food web. These will indeed be multiple simple tests, e.g. 'Cow can eat grass', and so the like...

Describe alternatives you've considered

None.

Additional context

The difficulty of this Issue is suitable for experienced juniors.

richelbilderbeek commented 5 years ago

I will open up this Issue for the devs of tonight :rainbow: