Question: Consider this unit test for C# ' s HashSet class: [ TestClass ( ) ] public class HashSetTests { private HashSet hs = new (

Consider this unit test for C#'s HashSet class:
[TestClass()]
public class HashSetTests
{
private HashSet hs = new ();
[TestMethod]
[ExpectedException( typeof( ArgumentException ))]
public void Remove_BecomesEmpty_Succeeds()
{
hs.Add(1);
hs.Remove(1);
}
}
You can consult the specification for C#'s HashSet class hereLinks to an external site., but it probably works the way you think it should.
Assume there are other tests in the test class that are not show here. Which of the following are design or correctness problems exhibited by this test? Select all that apply.
Group of answer choices
It is poorly named
It expects an exception when it should not
It calls more than one HashSet method
Its state is not self-contained

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!