...

/

Assertions and Test Cases for Enumerables and Collections

Assertions and Test Cases for Enumerables and Collections

Learn when and how to assert lists and objects contained in lists.

Introduction

Grouping objects into collections and performing actions on this collection are one of the most fundamental programming tasks. Given its importance, it’s helpful to recall the ICollection class and some of its capabilities.

The ICollection class is a base interface for all other classes in the System.Collections namespace. The generic equivalent is the System.Collections.Generic.ICollection<T> interface. The ICollection interface itself extends the IEnumerable interface. This basic schematic is shown in the figure below:

Access this course and 1400+ top-rated courses and projects.