You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
896 B

extends WAT.Test
var provider : MajorityJudgmentChatCommandJudgmentsProvider
func title():
return "Test Command Provider"
func start():
# Runs before all test related methods once
self.provider = MajorityJudgmentChatCommandJudgmentsProvider.new()
watch(self.provider, "judgment_emitted")
func pre():
# Runs before each test method
pass
func test_single_command():
do_test_single_command("A0", [0, 0])
do_test_single_command("B2", [1, 2])
do_test_single_command("e4", [4, 4])
func do_test_single_command(command:String, expected:Array):
var author = "Tester"
self.provider.process_chat_command(author, command)
asserts.signal_was_emitted(
self.provider,
"judgment_emitted",
"Signal was emitted"
)
asserts.signal_was_emitted_with_arguments(
self.provider,
"judgment_emitted",
[author, expected[0], expected[1]],
"Signal was emitted with correct arguments"
)