Example #1
0
 private void checkForMissingParameters(ArrayList keys, ParameterValidationFailureException condition)
 {
     foreach (string key in keys)
     {
         condition.MarkMissingParameter(key, this[key]);
     }
 }
        public void Verify(ParameterList actualList)
        {
            var expectedKeys = new ArrayList(AllKeys);
            var actualKeys = new ArrayList(actualList.AllKeys);
            var unionKeys = new ArrayList();

            var keys = (string[]) actualKeys.ToArray(typeof (string));

            foreach (string key in keys)
            {
                if (expectedKeys.Contains(key))
                {
                    unionKeys.Add(key);
                    expectedKeys.Remove(key);
                    actualKeys.Remove(key);
                }
            }

            var failureCondition = new ParameterValidationFailureException();

            checkForWrongParameterValues(unionKeys, actualList, failureCondition);
            checkForMissingParameters(expectedKeys, failureCondition);
            checkForUnExpectedParameters(actualList, actualKeys, failureCondition);

            failureCondition.ThrowIfExceptions();
        }
Example #3
0
        public void Verify(ParameterList actualList)
        {
            var expectedKeys = new ArrayList(AllKeys);
            var actualKeys   = new ArrayList(actualList.AllKeys);
            var unionKeys    = new ArrayList();

            var keys = (string[])actualKeys.ToArray(typeof(string));

            foreach (string key in keys)
            {
                if (expectedKeys.Contains(key))
                {
                    unionKeys.Add(key);
                    expectedKeys.Remove(key);
                    actualKeys.Remove(key);
                }
            }

            var failureCondition = new ParameterValidationFailureException();

            checkForWrongParameterValues(unionKeys, actualList, failureCondition);
            checkForMissingParameters(expectedKeys, failureCondition);
            checkForUnExpectedParameters(actualList, actualKeys, failureCondition);

            failureCondition.ThrowIfExceptions();
        }
Example #4
0
 private void checkForUnExpectedParameters(ParameterList list, ArrayList keys,
                                           ParameterValidationFailureException condition)
 {
     foreach (string key in keys)
     {
         condition.MarkUnexpectedParameter(key, list[key]);
     }
 }
Example #5
0
        private void checkForWrongParameterValues(ArrayList unionKeys, ParameterList actualList,
                                                  ParameterValidationFailureException failureCondition)
        {
            foreach (string key in unionKeys)
            {
                object expected = this[key];
                object actual   = actualList[key];

                if (!expected.Equals(actual))
                {
                    failureCondition.MarkWrongParameterValue(key, expected, actual);
                }
            }
        }
 private void checkForMissingParameters(ArrayList keys, ParameterValidationFailureException condition)
 {
     foreach (string key in keys)
     {
         condition.MarkMissingParameter(key, this[key]);
     }
 }
        private void checkForWrongParameterValues(ArrayList unionKeys, ParameterList actualList,
            ParameterValidationFailureException failureCondition)
        {
            foreach (string key in unionKeys)
            {
                object expected = this[key];
                object actual = actualList[key];

                if (!expected.Equals(actual))
                {
                    failureCondition.MarkWrongParameterValue(key, expected, actual);
                }
            }
        }
 private void checkForUnExpectedParameters(ParameterList list, ArrayList keys,
     ParameterValidationFailureException condition)
 {
     foreach (string key in keys)
     {
         condition.MarkUnexpectedParameter(key, list[key]);
     }
 }