コード例 #1
0
 public static void Start()
 {
     if (Arguments.Contains("t"))
     {
         IntegrationTestRunner.RunIntegrationTests(typeof(Program).Assembly);
     }
     else
     {
         Interactive();
     }
 }
コード例 #2
0
ファイル: Program.cs プロジェクト: ThreeHeadz/Bam.Net
 public static void RunIntegrationTestsInFile(string assemblyPath = null, string endDirectory = null)
 {
     assemblyPath = assemblyPath ?? Arguments["IntegrationTests"];
     try
     {
         Assembly assembly = Assembly.LoadFrom(assemblyPath);
         IntegrationTestRunner.RunIntegrationTests(assembly);
     }
     catch (Exception ex)
     {
         HandleException(ex);
     }
 }
コード例 #3
0
        public static void Initialize(string[] args, ConsoleArgsParsedDelegate parseErrorHandler = null)
        {
            AssemblyResolve.Monitor(() =>
            {
                ILogger logger = Logger;
                if (logger == null)
                {
                    logger = new ConsoleLogger {
                        AddDetails = false
                    };
                    logger.StartLoggingThread();
                }
                return(logger);
            });

            if (parseErrorHandler == null)
            {
                parseErrorHandler = (a) =>
                {
                    throw new ArgumentException(a.Message);
                };
            }

            ArgsParsedError += parseErrorHandler;

            AddValidArgument("i", true, description: "Run interactively");
            AddValidArgument("?", true, description: "Show usage");
            AddValidArgument("t", true, description: "Run all unit tests");
            AddValidArgument("it", true, description: "Run all integration tests");

            ParseArgs(args);

            if (Arguments.Contains("?"))
            {
                Usage(Assembly.GetEntryAssembly());
                Exit();
            }
            else if (Arguments.Contains("i"))
            {
                Interactive();
                return;
            }
            else if (Arguments.Contains("t"))
            {
                RunAllUnitTests(Assembly.GetEntryAssembly());
                return;
            }
            else if (Arguments.Contains("it"))
            {
                IntegrationTestRunner.RunIntegrationTests(Assembly.GetEntryAssembly());
                return;
            }
            else
            {
                if (DefaultMethod != null)
                {
                    Expect.IsTrue(DefaultMethod.IsStatic, "DefaultMethod must be static.");
                    if (DefaultMethod.GetParameters().Length > 0)
                    {
                        DefaultMethod.Invoke(null, new object[] { Arguments });
                    }
                    else
                    {
                        DefaultMethod.Invoke(null, null);
                    }
                    return;
                }
            }
        }
コード例 #4
0
 public static void RunIntegrationTests()
 {
     IntegrationTestRunner.RunIntegrationTests(Assembly.GetEntryAssembly());
 }
コード例 #5
0
 public void RunCrudTests()
 {
     IntegrationTestRunner.RunIntegrationTests(typeof(DaoCrudTests));
 }
コード例 #6
0
 public void RunQueryTests()
 {
     IntegrationTestRunner.RunIntegrationTests(typeof(DaoQueryTests));
 }
コード例 #7
0
 public void RunSchemaExtractorTests()
 {
     IntegrationTestRunner.RunIntegrationTests(typeof(SchemaExtractorTests));
 }
コード例 #8
0
 public void RunIntegrationTests()
 {
     IntegrationTestRunner.RunIntegrationTests(typeof(Program).Assembly);
 }
コード例 #9
0
 public void RunRepositoryIntegrationTests()
 {
     IntegrationTestRunner.RunIntegrationTests(typeof(RepositoryIntegrationTests));
 }