Here is a unit test written in C# for VSUnit that adds an element to a .NET ArrayList instance. The test first creates a new array list, where the parameter to the constructor is the initial capacity, then adds a new object to the array list, and finally checks that the addition was...
When we inspected the causes of the failing tests, we found that in the constructor of the Heap class, a default array of size 4 (of type int) is created to store the items. In C#, an integer array is by default assigned values zero to the elements of the array. Therefore, there ...
Here is a unit test method written in C# for VSUnit that adds an element to a .NET ArrayList instance. The test first creates a new array list, where the parameter to the constructor is the initial capacity, then adds a new object to the array list, and finally checks that the ...