Пример #1
0
        /// <summary>
        /// Called when a validation fails on the parameters.
        /// </summary>
        /// <param name="pDesc">The description of the failed parameter.</param>
        /// <param name="pError">The type of error.</param>
        public void Error(Description pDesc, eERROR pError)
        {
            switch (pError)
            {
            case eERROR.REQUIRED:
                _output.Error(OutputFormatter.WriteRequired(pDesc.Role, _options.Prefix, pDesc.Name));
                return;

            case eERROR.DUPLICATE:
                _output.Error(OutputFormatter.WriteDuplicate(pDesc.Role, _options.Prefix, pDesc.Name));
                return;

            case eERROR.MISSING_VALUE:
                _output.Error(OutputFormatter.WriteMissingValue(pDesc.Role, _options.Prefix, pDesc.Name));
                return;
            }

            throw new InvalidArgumentException("Unsupported error type");
        }
Пример #2
0
        public void Create()
        {
            ConsoleFactory factory = new ConsoleFactory();
            iOutputStream  stream  = factory.Create();

            Assert.IsNotNull(stream);

            stream.Standard("test");
            stream.Error("test");
        }