Ejemplo n.º 1
0
        public ConstantEnumerationValueFilter(Enum[] disabledValues)
        {
            ArgumentUtility.CheckNotNullOrEmptyOrItemsNull("disabledValues", disabledValues);
            ArgumentUtility.CheckItemsType("disabledValues", disabledValues, disabledValues[0].GetType());

            _disabledEnumValues = disabledValues;
        }
Ejemplo n.º 2
0
        public void Fail_zItemNullICollection()
        {
            ArrayList list = new ArrayList();

            list.Add(null);
            ArgumentUtility.CheckNotNullOrEmptyOrItemsNull("arg", list);
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
            public AttributeConstraint(string message, params Type[] propertyTypes)
            {
                ArgumentUtility.CheckNotNullOrEmpty("message", message);
                ArgumentUtility.CheckNotNullOrEmptyOrItemsNull("propertyTypes", propertyTypes);

                _propertyTypes = propertyTypes;
                _message       = message;
            }
Ejemplo n.º 5
0
        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;
        }
Ejemplo n.º 9
0
 public void Succeed_Array()
 {
     string[] array  = new string[] { "test" };
     string[] result = ArgumentUtility.CheckNotNullOrEmptyOrItemsNull("arg", array);
     Assert.That(result, Is.SameAs(array));
 }
Ejemplo n.º 10
0
 public void Fail_EmptyIEnumerable()
 {
     ArgumentUtility.CheckNotNullOrEmptyOrItemsNull("arg", GetEmptyEnumerable());
 }
Ejemplo n.º 11
0
 public void Fail_EmptyCollection()
 {
     ArgumentUtility.CheckNotNullOrEmptyOrItemsNull("arg", new ArrayList());
 }
Ejemplo n.º 12
0
 public void Fail_EmptyArray()
 {
     ArgumentUtility.CheckNotNullOrEmptyOrItemsNull("arg", new string[0]);
 }
Ejemplo n.º 13
0
 public void Fail_NullICollection()
 {
     ArgumentUtility.CheckNotNullOrEmptyOrItemsNull("arg", (ICollection)null);
 }