The `List ShouldContain` assertion in the C# NUnit.Framework package is used to verify that a list contains a certain element. It can be used to test whether a certain item is present in a list or not.
Example:
[Test]
public void TestList()
{
List list = new List{1, 2, 3, 4, 5};
Assert.That(list, Contains.Item(3));
}
In this example, we create a `List` with five elements. We then use the `Assert.That` method to test whether the list contains the item `3`. This uses the `Contains.Item()` method of the `NUnit.Framework` package.
Package library: NUnit.Framework.
C# (CSharp) NUnit.Framework List.ShouldContain - 16 examples found. These are the top rated real world C# (CSharp) examples of NUnit.Framework.List.ShouldContain extracted from open source projects. You can rate examples to help us improve the quality of examples.