ArgumentHasElements() public static method

Checks the value of the supplied ICollection argument and throws an ArgumentException if it is , contains no elements or only null elements.
/// If the supplied is , /// contains no elements or only null elements. ///
public static ArgumentHasElements ( ICollection argument, string name ) : void
argument ICollection The array or collection to check.
name string The argument name.
return void
 public void ArgumentHasElementsArgumentContainsNonNullsOnly()
 {
     AssertUtils.ArgumentHasElements(new object[] { new object(), new object(), new object() }, "foo");
 }
 public void ArgumentHasElementsArgumentContainsNull()
 {
     Assert.Throws <ArgumentException>(() => AssertUtils.ArgumentHasElements(new object[] { new object(), null, new object() }, "foo"));
 }
 public void ArgumentHasElementsArgumentIsEmpty()
 {
     Assert.Throws <ArgumentException>(() => AssertUtils.ArgumentHasElements(new object[0], "foo"));
 }
 public void ArgumentHasElementsArgumentIsNull()
 {
     Assert.Throws <ArgumentException>(() => AssertUtils.ArgumentHasElements(null, "foo"));
 }
Esempio n. 5
0
 public void ArgumentHasElementsArgumentIsEmpty()
 {
     AssertUtils.ArgumentHasElements(new object[0], "foo");
 }
Esempio n. 6
0
 public void ArgumentHasElementsArgumentIsNull()
 {
     AssertUtils.ArgumentHasElements(null, "foo");
 }