コード例 #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));
            }
コード例 #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>());
 }
コード例 #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);
 }
コード例 #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);
 }
コード例 #5
0
 public void WhenCopyToNullArray_ThenThrows <T>(EnumSet <T> set) where T : struct, Enum
 {
     Assert.That(() => set.CopyTo(null, 0), Throws.ArgumentNullException);
 }