public ConstantEnumerationValueFilter(Enum[] disabledValues) { ArgumentUtility.CheckNotNullOrEmptyOrItemsNull("disabledValues", disabledValues); ArgumentUtility.CheckItemsType("disabledValues", disabledValues, disabledValues[0].GetType()); _disabledEnumValues = disabledValues; }
public void Fail_zItemNullICollection() { ArrayList list = new ArrayList(); list.Add(null); ArgumentUtility.CheckNotNullOrEmptyOrItemsNull("arg", list); }
public void Succeed_IEnumerable() { IEnumerable enumerable = GetEnumerableWithValue(); IEnumerable result = ArgumentUtility.CheckNotNullOrEmptyOrItemsNull("arg", enumerable); Assert.That(result, Is.SameAs(enumerable)); Assert.That(result.GetEnumerator().MoveNext(), Is.True); }
public AttributeConstraint(string message, params Type[] propertyTypes) { ArgumentUtility.CheckNotNullOrEmpty("message", message); ArgumentUtility.CheckNotNullOrEmptyOrItemsNull("propertyTypes", propertyTypes); _propertyTypes = propertyTypes; _message = message; }
public void Succeed_Collection() { ArrayList list = new ArrayList(); list.Add("test"); ArrayList result = ArgumentUtility.CheckNotNullOrEmptyOrItemsNull("arg", list); Assert.That(result, Is.SameAs(list)); }
private void CheckContains(IEnumerable <IAccessorInterceptor> accessorInterceptors, params MethodInfo[] expectedInterceptedAccessors) { ArgumentUtility.CheckNotNull("accessorInterceptors", accessorInterceptors); ArgumentUtility.CheckNotNullOrEmptyOrItemsNull("expectedInterceptedAccessors", expectedInterceptedAccessors); var actualInterceptedAccessors = accessorInterceptors.Select(GetInterceptedAccessorMethod); CollectionAssert.IsSubsetOf(expectedInterceptedAccessors, actualInterceptedAccessors); }
public PrimaryKeyConstraintDefinition(string constraintName, bool isClustered, IEnumerable <ColumnDefinition> columns) { ArgumentUtility.CheckNotNullOrEmpty("constraintName", constraintName); ArgumentUtility.CheckNotNull("columns", columns); var columnsList = columns.ToList().AsReadOnly(); ArgumentUtility.CheckNotNullOrEmptyOrItemsNull("columns", columnsList); _constraintName = constraintName; _isClustered = isClustered; _columns = columnsList; }
private DemandPermissionAttribute(object[] accessTypes) { ArgumentUtility.CheckNotNullOrEmptyOrItemsNull("accessTypes", accessTypes); ArgumentUtility.CheckItemsType("accessTypes", accessTypes, typeof(Enum)); Enum[] accessTypeEnums = new Enum[accessTypes.Length]; for (int i = 0; i < accessTypes.Length; i++) { accessTypeEnums[i] = GetAccessType(accessTypes[i]); } _accessTypes = accessTypeEnums; }
public void Succeed_Array() { string[] array = new string[] { "test" }; string[] result = ArgumentUtility.CheckNotNullOrEmptyOrItemsNull("arg", array); Assert.That(result, Is.SameAs(array)); }
public void Fail_EmptyIEnumerable() { ArgumentUtility.CheckNotNullOrEmptyOrItemsNull("arg", GetEmptyEnumerable()); }
public void Fail_EmptyCollection() { ArgumentUtility.CheckNotNullOrEmptyOrItemsNull("arg", new ArrayList()); }
public void Fail_EmptyArray() { ArgumentUtility.CheckNotNullOrEmptyOrItemsNull("arg", new string[0]); }
public void Fail_NullICollection() { ArgumentUtility.CheckNotNullOrEmptyOrItemsNull("arg", (ICollection)null); }