ArgumentHasLength() public static method

Checks the value of the supplied ICollection argument and throws an ArgumentNullException if it is or contains no elements.
/// If the supplied is or /// contains no elements. ///
public static ArgumentHasLength ( ICollection argument, string name ) : void
argument ICollection The array or collection to check.
name string The argument name.
return void
Ejemplo n.º 1
0
 public void ArgumentHasLengthArgumentHasElementsWithMessage()
 {
     AssertUtils.ArgumentHasLength(new byte[1], "foo", "Bang!");
 }
Ejemplo n.º 2
0
 public void ArgumentHasLengthArgumentIsEmptyWithMessage()
 {
     Assert.Throws <ArgumentNullException>(() => AssertUtils.ArgumentHasLength(new byte[0], "foo", "Bang!"));
 }
Ejemplo n.º 3
0
 public void ArgumentHasLengthArgumentHasElements()
 {
     AssertUtils.ArgumentHasLength(new byte[1], "foo");
 }
Ejemplo n.º 4
0
 public void ArgumentHasLengthArgumentIsNull()
 {
     Assert.Throws <ArgumentNullException>(() => AssertUtils.ArgumentHasLength(null, "foo"));
 }
Ejemplo n.º 5
0
 public void ArgumentHasLengthArgumentIsEmptyWithMessage()
 {
     AssertUtils.ArgumentHasLength(new byte[0], "foo", "Bang!");
 }
Ejemplo n.º 6
0
 public void ArgumentHasLengthArgumentIsEmpty()
 {
     AssertUtils.ArgumentHasLength(new byte[0], "foo");
 }
Ejemplo n.º 7
0
 public void ArgumentHasLengthArgumentIsNullWithMessage()
 {
     AssertUtils.ArgumentHasLength(null, "foo", "Bang!");
 }
Ejemplo n.º 8
0
 public void ArgumentHasLengthArgumentIsNull()
 {
     AssertUtils.ArgumentHasLength(null, "foo");
 }