123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349 |
- # test_prostitution_functions
- !! ------------------------------------------------------------------------------------
- !! $LOCATIONNAME = the tested location with the test_ prefix.
- !! E.g.: test_korrPar, test_internet_mobile, test_prostitution_functions, etc.
- !! ------------------------------------------------------------------------------------
- !! @locationsetup
-
- _ISTEST = 1
- $LOCATIONNAME = 'prostitution_functions'
-
- !! ------------------------------------------------------------------------------------
- !! Run the tests - add the calls to the tests for the location that have to be run.
- !! ------------------------------------------------------------------------------------
-
- !! @run test_set_pavlovsk_prostitute_1
- !! @run test_set_pavlovsk_prostitute_2
- !! @run test_set_pavlovsk_prostitute_3
- !! @run test_set_pavlovsk_prostitute_blocked_1
- !! @run test_set_pavlovsk_prostitute_blocked_2
- !! @run test_set_pavlovsk_prostitute_blocked_3
- !! @run test_prostitute_work_hours_735am
- !! @run test_prostitute_work_hours_535pm_check_loc
- !! @run 'test_prostitute_work_hours_1am_Pavlovsk'
- !! @run test_prostitute_work_hours_1am_Pushkin
- !! @run test_is_solicitation_location_pav_commercial
- !! @run test_is_solicitation_location_city_center
- !! ------------------------------------------------------------------------------------
- !! @tests
- if $ARGS[0] = 'test_set_pavlovsk_prostitute_1':
- $TESTNAME = 'Prostitute fame > 250, Slut fame < 250 check if Pavlovsk prostitution is enabled.'
- $FUNCTIONNAME = 'set_pavlovsk_prostitute'
- if _ISVALIDCALL['<<$LOCATIONNAME>>,<<$FUNCTIONNAME>>'] ! 0:
- gs 'testframework', 'testsetup'
- fame['pav_prostitute'] = 260
- fame['pav_slut'] = 0
- prostitute['blocked'] = 0
- EXPECTED = 1
- $EXPECTED_MESSAGE = "prostitute['pavlovsk'] = <<EXPECTED>>"
-
- gs $LOCATIONNAME, $FUNCTIONNAME
- *clr & cla
- ACTUAL = prostitute['pavlovsk']
- $ACTUAL_MESSAGE = "prostitute['pavlovsk'] = <<ACTUAL>>"
- TESTRESULT = EXPECTED = ACTUAL
- else:
- $ACTUAL_MESSAGE = '<<$LOCATIONNAME>> <<$FUNCTIONNAME>> does not exist.'
- end
- gs 'testframework', 'addTestResult'
- gs 'testframework', 'testDefaultCleanup'
- killvar 'fame'
- killvar 'prostitute'
- end
- if $ARGS[0] = 'test_set_pavlovsk_prostitute_2':
- $TESTNAME = 'Prostitute fame > 250, Slut fame < 250 check if prostitution is now active.'
- $FUNCTIONNAME = 'set_pavlovsk_prostitute'
- if _ISVALIDCALL['<<$LOCATIONNAME>>,<<$FUNCTIONNAME>>'] ! 0:
- gs 'testframework', 'testsetup'
- fame['pav_prostitute'] = 260
- fame['pav_slut'] = 0
- prostitute['blocked'] = 0
- EXPECTED = 1
- $EXPECTED_MESSAGE = "prostitute['active'] = <<EXPECTED>>"
-
- gs $LOCATIONNAME, $FUNCTIONNAME
- *clr & cla
- ACTUAL = prostitute['active']
- $ACTUAL_MESSAGE = "prostitute['active'] = <<ACTUAL>>"
- TESTRESULT = EXPECTED = ACTUAL
- else:
- $ACTUAL_MESSAGE = '<<$LOCATIONNAME>> <<$FUNCTIONNAME>> does not exist.'
- end
- gs 'testframework', 'addTestResult'
- gs 'testframework', 'testDefaultCleanup'
- killvar 'fame'
- killvar 'prostitute'
- end
- if $ARGS[0] = 'test_set_pavlovsk_prostitute_3':
- $TESTNAME = 'Prostitute fame > 250, Slut fame < 250 check if prostitution payment method is 1.'
- $FUNCTIONNAME = 'set_pavlovsk_prostitute'
- if _ISVALIDCALL['<<$LOCATIONNAME>>,<<$FUNCTIONNAME>>'] ! 0:
- gs 'testframework', 'testsetup'
- fame['pav_prostitute'] = 260
- fame['pav_slut'] = 0
- prostitute['blocked'] = 0
- EXPECTED = 1
- $EXPECTED_MESSAGE = "prostitute['payment_method'] = <<EXPECTED>>"
-
- gs $LOCATIONNAME, $FUNCTIONNAME
- *clr & cla
- ACTUAL = prostitute['payment_method']
- $ACTUAL_MESSAGE = "prostitute['payment_method'] = <<ACTUAL>>"
- TESTRESULT = EXPECTED = ACTUAL
- else:
- $ACTUAL_MESSAGE = '<<$LOCATIONNAME>> <<$FUNCTIONNAME>> does not exist.'
- end
- gs 'testframework', 'addTestResult'
- gs 'testframework', 'testDefaultCleanup'
- killvar 'fame'
- killvar 'prostitute'
- end
- if $ARGS[0] = 'test_set_pavlovsk_prostitute_blocked_1':
- $TESTNAME = 'Prostitute fame > 250, Slut fame > 250, prostitution is blocked, check if Pavlovsk prostitution is inactive.'
- $FUNCTIONNAME = 'set_pavlovsk_prostitute'
- if _ISVALIDCALL['<<$LOCATIONNAME>>,<<$FUNCTIONNAME>>'] ! 0:
- gs 'testframework', 'testsetup'
- fame['pav_prostitute'] = 260
- fame['pav_slut'] = 270
- prostitute['blocked'] = 1
- EXPECTED = 0
- $EXPECTED_MESSAGE = "prostitute['pavlovsk'] = <<EXPECTED>>"
-
- gs $LOCATIONNAME, $FUNCTIONNAME
- *clr & cla
- ACTUAL = prostitute['pavlovsk']
- $ACTUAL_MESSAGE = "prostitute['pavlovsk'] = <<ACTUAL>>"
- TESTRESULT = EXPECTED = ACTUAL
- else:
- $ACTUAL_MESSAGE = '<<$LOCATIONNAME>> <<$FUNCTIONNAME>> does not exist.'
- end
- gs 'testframework', 'addTestResult'
- gs 'testframework', 'testDefaultCleanup'
- killvar 'fame'
- killvar 'prostitute'
- end
- if $ARGS[0] = 'test_set_pavlovsk_prostitute_blocked_2':
- $TESTNAME = 'Prostitute fame > 250, Slut fame > 250, prostitution is blocked check if prostitution is inactive.'
- $FUNCTIONNAME = 'set_pavlovsk_prostitute'
- if _ISVALIDCALL['<<$LOCATIONNAME>>,<<$FUNCTIONNAME>>'] ! 0:
- gs 'testframework', 'testsetup'
- fame['pav_prostitute'] = 260
- fame['pav_slut'] = 270
- prostitute['blocked'] = 1
- EXPECTED = 0
- $EXPECTED_MESSAGE = "prostitute['active'] = <<EXPECTED>>"
-
- gs $LOCATIONNAME, $FUNCTIONNAME
- *clr & cla
- ACTUAL = prostitute['active']
- $ACTUAL_MESSAGE = "prostitute['active'] = <<ACTUAL>>"
- TESTRESULT = EXPECTED = ACTUAL
- else:
- $ACTUAL_MESSAGE = '<<$LOCATIONNAME>> <<$FUNCTIONNAME>> does not exist.'
- end
- gs 'testframework', 'addTestResult'
- gs 'testframework', 'testDefaultCleanup'
- killvar 'fame'
- killvar 'prostitute'
- end
- if $ARGS[0] = 'test_set_pavlovsk_prostitute_blocked_3':
- $TESTNAME = 'Prostitute fame > 250, Slut fame > 250, Pavlovsk prostitution is active and prostitution gets blocked: check if Pavlovsk prostitution is inactive.'
- $FUNCTIONNAME = 'set_pavlovsk_prostitute'
- if _ISVALIDCALL['<<$LOCATIONNAME>>,<<$FUNCTIONNAME>>'] ! 0:
- gs 'testframework', 'testsetup'
- fame['pav_prostitute'] = 260
- fame['pav_slut'] = 270
- prostitute['active'] = 1
- prostitute['pavlovsk'] = 1
- prostitute['blocked'] = 1
- EXPECTED = 0
- $EXPECTED_MESSAGE = "prostitute['pavlovsk'] = <<EXPECTED>>"
-
- gs $LOCATIONNAME, $FUNCTIONNAME
- *clr & cla
- ACTUAL = prostitute['pavlovsk']
- $ACTUAL_MESSAGE = "prostitute['pavlovsk'] = <<ACTUAL>>"
- TESTRESULT = EXPECTED = ACTUAL
- else:
- $ACTUAL_MESSAGE = '<<$LOCATIONNAME>> <<$FUNCTIONNAME>> does not exist.'
- end
- gs 'testframework', 'addTestResult'
- gs 'testframework', 'testDefaultCleanup'
- killvar 'fame'
- killvar 'prostitute'
- end
- if $ARGS[0] = 'test_prostitute_work_hours_735am':
- $TESTNAME = 'Region is Pavlovsk, 7:35am, check if work hours check returns false.'
- $FUNCTIONNAME = 'prostitute_work_hours'
- if _ISVALIDCALL['<<$LOCATIONNAME>>,<<$FUNCTIONNAME>>'] ! 0:
- gs 'testframework', 'testsetup'
- $region = 'pav'
- hour = 7
- minut = 35
- EXPECTED = _FALSE
- $EXPECTED_MESSAGE = "FUNC('prostitution_functions', 'prostitute_work_hours') => <<EXPECTED>>"
- ACTUAL = FUNC($LOCATIONNAME, $FUNCTIONNAME)
- $ACTUAL_MESSAGE = "FUNC('<<$LOCATIONNAME>>', '<<$FUNCTIONNAME>>') => <<ACTUAL>>"
- TESTRESULT = EXPECTED = ACTUAL
- else:
- $ACTUAL_MESSAGE = '<<$LOCATIONNAME>> <<$FUNCTIONNAME>> does not exist.'
- end
- gs 'testframework', 'addTestResult'
- gs 'testframework', 'testDefaultCleanup'
- killvar 'region'
- end
- if $ARGS[0] = 'test_prostitute_work_hours_535pm_check_loc':
- $TESTNAME = "Location is Pavlovsk NoSuchLocation (location is checked if starts with 'pav_'), 5:35pm, check if work hours check returns true."
- $FUNCTIONNAME = 'prostitute_work_hours'
- if _ISVALIDCALL['<<$LOCATIONNAME>>,<<$FUNCTIONNAME>>'] ! 0:
- gs 'testframework', 'testsetup'
- $loc = 'pav_nosuchplace'
- hour = 17
- minut = 35
- EXPECTED = _TRUE
- $EXPECTED_MESSAGE = "FUNC('<<$LOCATIONNAME>>', '<<$FUNCTIONNAME>>') => <<EXPECTED>>"
- ACTUAL = FUNC($LOCATIONNAME, $FUNCTIONNAME)
- $ACTUAL_MESSAGE = "FUNC('<<$LOCATIONNAME>>', <<$FUNCTIONNAME>>') => <<ACTUAL>>"
- TESTRESULT = EXPECTED = ACTUAL
- else:
- $ACTUAL_MESSAGE = '<<$LOCATIONNAME>> <<$FUNCTIONNAME>> does not exist.'
- end
- gs 'testframework', 'addTestResult'
- gs 'testframework', 'testDefaultCleanup'
- killvar 'loc'
- end
- if $ARGS[0] = 'test_prostitute_work_hours_1am_Pavlovsk':
- $TESTNAME = 'Region is Pavlovsk, 1:00am, check if work hours check returns false.'
- $FUNCTIONNAME = 'prostitute_work_hours'
- if _ISVALIDCALL['<<$LOCATIONNAME>>,<<$FUNCTIONNAME>>'] ! 0:
- gs 'testframework', 'testsetup'
- $region = 'pav'
- hour = 1
- minut = 0
- EXPECTED = _FALSE
- $EXPECTED_MESSAGE = "FUNC('<<$LOCATIONNAME>>', <<$FUNCTIONNAME>>') => <<EXPECTED>>"
- ACTUAL = FUNC($LOCATIONNAME, $FUNCTIONNAME)
- $ACTUAL_MESSAGE = "FUNC('<<$LOCATIONNAME>>', <<$FUNCTIONNAME>>') => <<ACTUAL>>"
- TESTRESULT = EXPECTED = ACTUAL
- else:
- $ACTUAL_MESSAGE = '<<$LOCATIONNAME>> <<$FUNCTIONNAME>> does not exist.'
- end
- gs 'testframework', 'addTestResult'
- gs 'testframework', 'testDefaultCleanup'
- killvar 'region'
- end
- if $ARGS[0] = 'test_prostitute_work_hours_1am_Pushkin':
- $TESTNAME = 'Region is Pushkin, 1:00am, check if work hours check returns true.'
- $FUNCTIONNAME = 'prostitute_work_hours'
- if _ISVALIDCALL['<<$LOCATIONNAME>>,<<$FUNCTIONNAME>>'] ! 0:
- gs 'testframework', 'testsetup'
- $region = 'pushkin'
- hour = 1
- minut = 0
- EXPECTED = _TRUE
- $EXPECTED_MESSAGE = "FUNC('<<$LOCATIONNAME>>', <<$FUNCTIONNAME>>') => <<EXPECTED>>"
- ACTUAL = FUNC($LOCATIONNAME, $FUNCTIONNAME)
- $ACTUAL_MESSAGE = "FUNC('<<$LOCATIONNAME>>', <<$FUNCTIONNAME>>') => <<ACTUAL>>"
- TESTRESULT = EXPECTED = ACTUAL
- else:
- $ACTUAL_MESSAGE = '<<$LOCATIONNAME>> <<$FUNCTIONNAME>> does not exist.'
- end
- gs 'testframework', 'addTestResult'
- gs 'testframework', 'testDefaultCleanup'
- killvar 'region'
- end
- if $ARGS[0] = 'test_is_solicitation_location_pav_commercial':
- $TESTNAME = "Location is Pavlovsk Commercial, check if solicitation location check returns true."
- $FUNCTIONNAME = 'is_solicitation_location'
- if _ISVALIDCALL['<<$LOCATIONNAME>>,<<$FUNCTIONNAME>>'] ! 0:
- gs 'testframework', 'testsetup'
- $loc = 'pav_commercial'
- menu_off = 0
- $loc_arg = ''
- EXPECTED = _TRUE
- $EXPECTED_MESSAGE = "FUNC('<<$LOCATIONNAME>>', '<<$FUNCTIONNAME>>') => <<EXPECTED>>"
- ACTUAL = FUNC($LOCATIONNAME, $FUNCTIONNAME, -1)
- $ACTUAL_MESSAGE = "FUNC('<<$LOCATIONNAME>>', '<<$FUNCTIONNAME>>') => <<ACTUAL>>"
- TESTRESULT = EXPECTED = ACTUAL
- else:
- $ACTUAL_MESSAGE = '<<$LOCATIONNAME>> <<$FUNCTIONNAME>> does not exist.'
- end
- gs 'testframework', 'addTestResult'
- gs 'testframework', 'testDefaultCleanup'
- killvar 'loc'
- killvar 'menu_off'
- killvar 'loc_arg'
- end
- if $ARGS[0] = 'test_is_solicitation_location_city_center':
- $TESTNAME = "Location is City Center, check if solicitation location check returns false."
- $FUNCTIONNAME = 'is_solicitation_location'
- if _ISVALIDCALL['<<$LOCATIONNAME>>,<<$FUNCTIONNAME>>'] ! 0:
- gs 'testframework', 'testsetup'
- $loc = 'city_center'
- menu_off = 0
- $loc_arg = ''
- EXPECTED = _FALSE
- $EXPECTED_MESSAGE = "FUNC('<<$LOCATIONNAME>>', '<<$FUNCTIONNAME>>') => <<EXPECTED>>"
-
- ACTUAL = FUNC($LOCATIONNAME, $FUNCTIONNAME, -1)
- $ACTUAL_MESSAGE = "FUNC('<<$LOCATIONNAME>>', '<<$FUNCTIONNAME>>') => <<ACTUAL>>"
- TESTRESULT = EXPECTED = ACTUAL
- else:
- $ACTUAL_MESSAGE = '<<$LOCATIONNAME>> <<$FUNCTIONNAME>> does not exist.'
- end
- gs 'testframework', 'addTestResult'
- gs 'testframework', 'testDefaultCleanup'
- killvar 'loc'
- killvar 'menu_off'
- killvar 'loc_arg'
- end
- killvar 'LOCATIONNAME'
- killvar '_ISTEST'
- --- test_prostitution_functions ---------------------------------
|