コード例 #1
0
        public void Execute()
        {
            var assembly = request.Container.Location;

            var testsToRun = context.GetTestsToRun().ToArray();

            var contexts = testsToRun
                           .Select(x => x.Context.TypeName)
                           .Distinct();

            var cache   = new ElementCache(testsToRun);
            var tracker = new RunTracker(testsToRun);

            var listener        = new TestExecutionListener(context, cache, token);
            var adapter         = new ExecutionAdapterRunListener(listener, cache, tracker);
            var loggingListener = new LoggingRunListener(adapter);
            var machineAdapter  = new AdapterListener(loggingListener, assembly);

            var runOptions = RunOptions.Custom.FilterBy(contexts);

            var runner = new AppDomainRunner(machineAdapter, runOptions);

            runner.RunAssembly(new AssemblyPath(request.Container.Location));

            listener.Finished.WaitOne();
        }
コード例 #2
0
   public void onAttach(Activity activity) {
        onAttach(activity);
 
        // This makes sure that the container activity has implemented
        // the callback interface. If not, it throws an exception
        try {
             mListener = (AdapterListener) activity;
        } catch (Exception e) {
             throw new Exception(activity.ToString()
                  + " must implement OnHeadlineSelectedListener");
        }
   }
コード例 #3
0
 public void setListener(AdapterListener listener)
 {
      mListener = listener;
 }