True or False: There is no way to use JUnit to test whether a method correctly throws an exception. Exceptions thrown by
Posted: Mon Jun 06, 2022 5:31 pm
True or False: There is no way to use JUnit to test whether a
method correctly throws an exception. Exceptions thrown by the
method being tested will always cause the JUnit test to fail.
Choice 1 of 2:True
Choice 2 of 2:False
Consider implementing two tests for inserting into a Hash Table
that uses a linear probing collision resolution strategy and the
modulo hash function (i.e. key % M where M is the size of the hash
table).
Your first test creates a hash table of size 11, inserts the
elements 13, 15 and 19, and then checks to ensure that the elements
are in the correct location in the array.
Which of the following tests is the best choice for your second
test?
Choice 1 of 3:Create a hash table of size 13 and insert 17, 15
and 1
Choice 2 of 3:Create a hash table of size 11 and insert 15, 25,
13 and 30
Choice 3 of 3:Create a hash table of size 11 and insert 3, 14,
and 4
method correctly throws an exception. Exceptions thrown by the
method being tested will always cause the JUnit test to fail.
Choice 1 of 2:True
Choice 2 of 2:False
Consider implementing two tests for inserting into a Hash Table
that uses a linear probing collision resolution strategy and the
modulo hash function (i.e. key % M where M is the size of the hash
table).
Your first test creates a hash table of size 11, inserts the
elements 13, 15 and 19, and then checks to ensure that the elements
are in the correct location in the array.
Which of the following tests is the best choice for your second
test?
Choice 1 of 3:Create a hash table of size 13 and insert 17, 15
and 1
Choice 2 of 3:Create a hash table of size 11 and insert 15, 25,
13 and 30
Choice 3 of 3:Create a hash table of size 11 and insert 3, 14,
and 4