public void WhenCopyToArray_ArrayHasAllElements <T>(EnumSet <T> set, int size) where T : struct, Enum { var array = new T[size]; set.CopyTo(array, 0); Assert.That(array, Is.EquivalentTo(set)); }
public void WhenCopyToIndexIsLessThanZero_ThenThrows <T>(EnumSet <T> set) where T : struct, Enum { Assert.That(() => set.CopyTo(new T[1], -1), Throws.TypeOf <ArgumentOutOfRangeException>()); }
public void WhenCopyToArrayWithTooFewElements_ThenThrows <T>(EnumSet <T> set, int size) where T : struct, Enum { Assert.That(() => set.CopyTo(new T[size], 0), Throws.ArgumentException); }
public void WhenCopyToIndexWithTooFewElementsRemaining_ThenThrows <T>(EnumSet <T> set, int size, int index) where T : struct, Enum { Assert.That(() => set.CopyTo(new T[size], index), Throws.ArgumentException); }
public void WhenCopyToNullArray_ThenThrows <T>(EnumSet <T> set) where T : struct, Enum { Assert.That(() => set.CopyTo(null, 0), Throws.ArgumentNullException); }