File: consumption_time_test.cpp

package info (click to toggle)
cataclysm-dda 0.H-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 710,808 kB
  • sloc: cpp: 524,019; python: 11,580; sh: 1,228; makefile: 1,169; xml: 507; javascript: 150; sql: 56; exp: 41; perl: 37
file content (22 lines) | stat: -rw-r--r-- 721 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include "avatar.h"
#include "item.h"
#include "cata_catch.h"

TEST_CASE( "characters_with_no_mutations_take_at_least_1_second_to_consume_comestibles",
           "[character][item][food][time]" )
{
    GIVEN( "a character with no mutations and a comestible" ) {
        avatar character;
        REQUIRE( character.my_mutations.empty() );

        item mustard( "mustard" );
        REQUIRE( mustard.is_comestible() );

        WHEN( "character wants to consume it" ) {
            time_duration time_to_consume = character.get_consume_time( mustard );
            THEN( "it should take the character at least 1 second to do so" ) {
                CHECK( time_to_consume >= 1_seconds );
            }
        }
    }
}