Exemplo n.º 1
0
        public void TestDefaultValuesBdOptions()
        {
            string[]        args  = ($"bd --paths {tempPaths}").Split();
            OptionsForSqlDb bdopt = null;

            Parser.Default.ParseArguments <OptionsForSqlDb>(args)
            .WithParsed <OptionsForSqlDb>(o => bdopt = o);
            Assert.IsNotNull(bdopt);
            Assert.AreEqual(OptionsForSqlDb.defaultConfigeFilePath, bdopt.ConfigeFilePath);
        }
Exemplo n.º 2
0
        public void TestOptionsForSqlDbConfig(
            [Values("-c", "--config")] string optionConfig)
        {
            string tempConfigeFilePath = "config.txt";

            string[] args = ($"bd " +
                             $"{optionConfig} {tempConfigeFilePath} " +
                             $"--paths {tempPaths}").Split();
            OptionsForSqlDb bdOpt = null;

            Parser.Default.ParseArguments <OptionsForSqlDb, OptionsForConsole, OptionsForFile>(args)
            .WithParsed <OptionsForSqlDb>(o => bdOpt = o);
            Assert.IsNotNull(bdOpt);
            Assert.AreEqual(tempPaths, String.Join(" ", bdOpt.Paths));
            Assert.AreEqual(tempConfigeFilePath, bdOpt.ConfigeFilePath);
        }
Exemplo n.º 3
0
 public ConnectionWithSqlDb(OptionsForSqlDb options)
 {
     this.options = options;
 }