public void CompiledCommandShouldThrowOnLackOfArguments(string methodName)
        {
            var method = typeof(CommandCompilerTests).GetMethod(methodName);
            var comp   = CommandCompiler.Compile(method, null);

            Assert.ThrowsException <CommandInvocationException>(()
                                                                => comp(string.Empty, Array.Empty <string>()));
        }
        // DoSomething06 and DoSomething07 would only fail for lack of arguments
        public void CompiledCommandShouldThrowOnConversionFail(string methodName, string inputString)
        {
            var method = typeof(CommandCompilerTests).GetMethod(methodName);
            var comp   = CommandCompiler.Compile(method, null);

            Assert.ThrowsException <CommandInvocationException>(()
                                                                => comp(string.Empty, new[] { inputString }));
        }
        public void CompiledCommandShouldRun(string methodName, string inputString, object expectedVal)
        {
            var method = typeof(CommandCompilerTests).GetMethod(methodName);
            var comp   = CommandCompiler.Compile(method, null);

            s_value = null;
            comp(string.Empty, inputString.Contains(";")
                ? inputString.Split(';')
                : (inputString.Length < 1 ? Array.Empty <string>() : new[] { inputString }));
            Assert.AreEqual(expectedVal, s_value);
        }
        public static BufferConverter GetConverter(MetadataIdentity metadata, ColumnMetadata columnMetadata)
        {
            CommandCacheKey cacheKey = new CommandCacheKey(metadata, columnMetadata);

            return(converterMap.GetOrAdd(cacheKey, k =>
            {
                CommandCompiler compiler = new CommandCompiler();

                return compiler.Compile(metadata, columnMetadata);
            }));
        }
        public static BufferWriter GetWriter(IReadOnlyList <ColumnName> columnNames)
        {
            CommandCacheKey cacheKey = new CommandCacheKey(columnNames);

            return(writerMap.GetOrAdd(cacheKey, k =>
            {
                CommandCompiler compiler = new CommandCompiler();

                return compiler.Compile(k.Columns);
            }));
        }
        public void ShouldCompile(string methodName)
        {
            var method = typeof(CommandCompilerTests).GetMethod(methodName) !;

            CommandCompiler.Compile(method, null);
        }