Пример #1
0
        /// <summary>
        /// Build a collection of constraint (in fact one by expected item)
        /// Pay really attention that CollectionContainsConstraint is expecting one unique item!
        /// So if you cant to check for several items, you need to apply several Constraint (one by expected item)
        /// </summary>
        protected virtual void BuildInternalConstraint()
        {
            NUnitCtr.Constraint ctr = null;
            foreach (var item in Expected)
            {
                var localCtr = new NUnitCtr.CollectionContainsConstraint(StringComparerHelper.Build(item));
                var usingCtr = localCtr.Using(Comparer);

                if (ctr != null)
                {
                    ctr = new AndConstraint(ctr, usingCtr);
                }
                else
                {
                    ctr = usingCtr;
                }
            }

            if (ctr == null)
            {
                ctr = new NUnitCtr.EmptyCollectionConstraint();
            }

            IResolveConstraint exp = ctr;

            InternalConstraint = exp.Resolve();
        }
Пример #2
0
        protected override NUnitCtr.Constraint BuildInternalConstraint()
        {
            NUnitCtr.Constraint ctr = null;
            foreach (var item in ExpectedItems)
            {
                var localCtr = new NUnitCtr.CollectionContainsConstraint(StringComparerHelper.Build(item));
                var usingCtr = localCtr.Using(Comparer);

                if (ctr != null)
                    ctr = new NUnitCtr.AndConstraint(ctr, usingCtr);
                else
                    ctr = usingCtr;
            }
            return ctr;
        }
Пример #3
0
        protected override NUnitCtr.Constraint BuildInternalConstraint()
        {
            NUnitCtr.Constraint ctr = null;
            foreach (var item in ExpectedItems)
            {
                var localCtr = new NUnitCtr.CollectionContainsConstraint(StringComparerHelper.Build(item));
                var usingCtr = localCtr.Using(Comparer);

                if (ctr != null)
                {
                    ctr = new NUnitCtr.AndConstraint(ctr, usingCtr);
                }
                else
                {
                    ctr = usingCtr;
                }
            }
            return(ctr);
        }
Пример #4
0
        /// <summary>
        /// Build a collection of constraint (in fact one by expected item)
        /// Pay really attention that CollectionContainsConstraint is expecting one unique item!
        /// So if you cant to check for several items, you need to apply several Constraint (one by expected item)
        /// </summary>
        protected virtual void BuildInternalConstraint()
        {
            NUnitCtr.Constraint ctr = null;
            foreach (var item in Expected)
            {
                var localCtr = new NUnitCtr.CollectionContainsConstraint(StringComparerHelper.Build(item));
                var usingCtr = localCtr.Using(Comparer);

                if (ctr != null)
                    ctr = new AndConstraint(ctr, usingCtr);
                else
                    ctr = usingCtr;
            }

            if (ctr == null)
                ctr = new NUnitCtr.EmptyCollectionConstraint();

            IResolveConstraint exp = ctr;
            InternalConstraint = exp.Resolve();
        }