Esempio n. 1
0
            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));
            }
Esempio n. 2
0
 public void WhenCopyToIndexIsLessThanZero_ThenThrows <T>(EnumSet <T> set) where T : struct, Enum
 {
     Assert.That(() => set.CopyTo(new T[1], -1), Throws.TypeOf <ArgumentOutOfRangeException>());
 }
Esempio n. 3
0
 public void WhenCopyToArrayWithTooFewElements_ThenThrows <T>(EnumSet <T> set, int size) where T : struct, Enum
 {
     Assert.That(() => set.CopyTo(new T[size], 0), Throws.ArgumentException);
 }
Esempio n. 4
0
 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);
 }
Esempio n. 5
0
 public void WhenCopyToNullArray_ThenThrows <T>(EnumSet <T> set) where T : struct, Enum
 {
     Assert.That(() => set.CopyTo(null, 0), Throws.ArgumentNullException);
 }