A collection of classes of distinct object instances gathered by the type of the exception which is expected to be raised when the subject instances are passed to a tested method or property.

Namespace:  MbUnit.Framework.ContractVerifiers
Assembly:  MbUnit (in MbUnit.dll) Version: 3.3.0.0 (3.3.610.0)

Syntax

C#
public class InvalidValuesClassCollection<T> : IEnumerable<InvalidValuesClass<T>>, 
	IEnumerable
Visual Basic (Declaration)
Public Class InvalidValuesClassCollection(Of T) _
	Implements IEnumerable(Of InvalidValuesClass(Of T)), IEnumerable

Type Parameters

T
The type of the object instances in the inner class collections.

Remarks

Distinct invalid instances are used by some contract verifiers such as AccessorContract<(Of <(TTarget, TValue>)>) to check for the correct detection of invalid or unexpected value assignment.

Use the default constructor to create an empty collection, then use the Add(Type, array<T>[]()[]) method, either explicitely.

CopyC#
var collection = new InvalidValuesClassCollection<Foo>();
collection.Add(typeof(ArgumentException), new Foo(1), new Foo(2));
collection.Add(typeof(ArgumentOutOfRangeException), new Foo(3));
Or by using the list initializer syntax, to feed the collection with classes of objects:
CopyC#
var collection = new InvalidValuesClassCollection<Foo>
{
    { typeof(ArgumentException), new Foo(1), new Foo(2) },
    { typeof(ArgumentOutOfRangeException), new Foo(3) }
};

Inheritance Hierarchy

System..::.Object
  MbUnit.Framework.ContractVerifiers..::.InvalidValuesClassCollection<(Of <(T>)>)

See Also