コード例 #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TestAssemblyStarting"/> class.
 /// </summary>
 public TestAssemblyStarting(IEnumerable <ITestCase> testCases, ITestAssembly testAssembly, DateTime startTime, string testEnvironment, string testFrameworkDisplayName)
     : base(testCases, testAssembly)
 {
     StartTime                = startTime;
     TestEnvironment          = testEnvironment;
     TestFrameworkDisplayName = testFrameworkDisplayName;
 }
コード例 #2
0
        public TestAssemblyRunner(ITestAssembly testAssembly,
                                  IEnumerable <IXunitTestCase> testCases,
                                  IMessageSink diagnosticMessageSink,
                                  IMessageSink executionMessageSink,
                                  ITestFrameworkExecutionOptions executionOptions)
            : base(testAssembly, testCases, diagnosticMessageSink, executionMessageSink, executionOptions)
        {
            var tests = OrderTestCollections();

            this.RunIntegrationTests = executionOptions.GetValue <bool>(nameof(ElasticXunitRunOptions.RunIntegrationTests));
            this.RunUnitTests        = executionOptions.GetValue <bool>(nameof(ElasticXunitRunOptions.RunUnitTests));
            this.TestFilter          = executionOptions.GetValue <string>(nameof(ElasticXunitRunOptions.TestFilter));
            this.ClusterFilter       = executionOptions.GetValue <string>(nameof(ElasticXunitRunOptions.ClusterFilter));

            //bit side effecty, sets up _assemblyFixtureMappings before possibly letting xunit do its regular concurrency thing
            this._grouped = (from c in tests
                             let cluster = ClusterFixture(c.Item2.First().TestMethod.TestClass)
                                           let testcase = new GroupedByCluster {
                Collection = c.Item1, TestCases = c.Item2, Cluster = cluster
            }
                             group testcase by testcase.Cluster
                             into g
                             orderby g.Count() descending
                             select g).ToList();
        }
コード例 #3
0
 /// <summary>
 /// Initializes a new <see cref="XunitTestAutomation"/>.
 /// </summary>
 /// <param name="testCase">An xUnit test case</param>
 /// <param name="testAssembly">The assembly containing the test case</param>
 public XunitTestAutomation(ITestCase testCase, ITestAssembly testAssembly)
 {
     Name       = testCase.DisplayName;
     Identifier = IdentifierFactory.CreateIdentifier(Name);
     Storage    = Path.GetFileName(testAssembly.Assembly.AssemblyPath);
     TestType   = "Unit Test";
 }
コード例 #4
0
ファイル: TestCollection.cs プロジェクト: nerdymishka/dotnet
 internal TestCollection(ITestAssembly testAssembly, ITypeInfo collectionDefinition, string displayName, Guid uniqueId)
 {
     CollectionDefinition = collectionDefinition;
     DisplayName          = displayName;
     TestAssembly         = testAssembly ?? throw new ArgumentNullException(nameof(testAssembly));
     UniqueID             = uniqueId;
 }
コード例 #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="XunitTestCollection"/> class.
 /// </summary>
 public XunitTestCollection(ITestAssembly testAssembly, ITypeInfo collectionDefinition, string displayName)
 {
     CollectionDefinition = collectionDefinition;
     DisplayName          = displayName;
     TestAssembly         = testAssembly;
     UniqueID             = Guid.NewGuid();
 }
コード例 #6
0
		public VsixTestCollection (ITestAssembly testAssembly, ITypeInfo collectionDefinition, 
			string visualStudioVersion, string rootSuffix)
			: base (testAssembly, collectionDefinition, visualStudioVersion + " (" + rootSuffix + ")")
		{
			VisualStudioVersion = visualStudioVersion;
			RootSuffix = rootSuffix;
		}
コード例 #7
0
        private void CreateNodesFor(ITestAssembly ta, int assemblyNodePosition)
        {
            var tests = ta.TestFixtureInfos;
            var root  = CreateOrFindAssemblyNode(ta, assemblyNodePosition);

            foreach (TestFixtureInfo tf in tests)
            {
                var classNode = CreateOrFindClassNode(ta, root.Nodes,
                                                      tf.FullName.Split(new[] { '.', '+' }),
                                                      0);
                classNode.Tag        = new UiElementInfo(ta, tf, null);
                classNode.ImageIndex = 2;
                foreach (TestMethodInfo tm in tf.TestMethods)
                {
                    var methodNode = CreateOrFindMethodNode(classNode.Nodes, tm);
                    methodNode.Tag = new UiElementInfo(ta, tf, tm);
                }
            }
            var temp = AfterSelect;

            AfterSelect = null;
            try {
                RestoreCheckState(root);
            }
            finally {
                AfterSelect = temp;
            }
            if (ConfigCurrentUser.AutoExpandTestHierarchy)
            {
                root.ExpandAll();
            }
        }
コード例 #8
0
 public UiElementInfo(ITestAssembly ta, TestSuite ts)
 {
     _assemblyName     = ta.Name.FullName.Split(",".ToCharArray())[0];
     _assemblyPathName = ta.Name.CodeBase;
     _fixtureFullName  = ts.FullName;
     _methodName       = string.Empty;
 }
コード例 #9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TestAssemblyStarting"/> class.
 /// </summary>
 public TestAssemblyStarting(IEnumerable<ITestCase> testCases, ITestAssembly testAssembly, DateTime startTime, string testEnvironment, string testFrameworkDisplayName)
     : base(testCases, testAssembly)
 {
     StartTime = startTime;
     TestEnvironment = testEnvironment;
     TestFrameworkDisplayName = testFrameworkDisplayName;
 }
コード例 #10
0
        /// <summary>
        /// Initializes a new instance of the <see cref="CollectionPerAssemblyTestCollectionFactory" /> class.
        /// </summary>
        /// <param name="testAssembly">The assembly.</param>
        /// <param name="messageAggregator">The message aggregator used to report <see cref="EnvironmentalWarning"/> messages.</param>
        public CollectionPerAssemblyTestCollectionFactory(ITestAssembly testAssembly, IMessageAggregator messageAggregator)
        {
            this.testAssembly = testAssembly;

            defaultCollection = new XunitTestCollection(testAssembly, null, "Test collection for " + Path.GetFileName(testAssembly.Assembly.AssemblyPath));
            collectionDefinitions = TestCollectionFactoryHelper.GetTestCollectionDefinitions(testAssembly.Assembly, messageAggregator);
        }
コード例 #11
0
 /// <summary>
 /// Initializes a new instance of the <see cref="XunitTestCollection"/> class.
 /// </summary>
 public XunitTestCollection(ITestAssembly testAssembly, ITypeInfo collectionDefinition, string displayName)
 {
     CollectionDefinition = collectionDefinition;
     DisplayName = displayName;
     TestAssembly = testAssembly;
     UniqueID = Guid.NewGuid();
 }
コード例 #12
0
ファイル: MainForm.cs プロジェクト: ManfredLange/csUnit
        private void OnAssemblyAdded(object sender, AssemblyEventArgs args)
        {
            ITestAssembly ta = RecipeFactory.Current[args.AssemblyFullName];

            HookupAssembly(ta);
            UpdateFormTitle();
        }
コード例 #13
0
 public PerformanceTestAssemblyRunner(ITestAssembly testAssembly,
                                      IEnumerable <IXunitTestCase> testCases,
                                      IMessageSink diagnosticMessageSink,
                                      IMessageSink executionMessageSink,
                                      ITestFrameworkExecutionOptions executionOptions,
                                      TestResourceSnapshotWriter testResourceSnapshotWriter,
                                      in bool resourceSnapshotEnabled) : base(testAssembly,
コード例 #14
0
        /// <summary>
        /// Initializes a new instance of the <see cref="CollectionPerAssemblyTestCollectionFactory" /> class.
        /// </summary>
        /// <param name="testAssembly">The assembly.</param>
        /// <param name="messageAggregator">The message aggregator used to report <see cref="EnvironmentalWarning"/> messages.</param>
        public CollectionPerAssemblyTestCollectionFactory(ITestAssembly testAssembly, IMessageAggregator messageAggregator)
        {
            this.testAssembly = testAssembly;

            defaultCollection     = new XunitTestCollection(testAssembly, null, "Test collection for " + Path.GetFileName(testAssembly.Assembly.AssemblyPath));
            collectionDefinitions = TestCollectionFactoryHelper.GetTestCollectionDefinitions(testAssembly.Assembly, messageAggregator);
        }
コード例 #15
0
        /// <summary>
        /// Initializes a new instance of the <see cref="CollectionPerAssemblyTestCollectionFactory" /> class.
        /// </summary>
        /// <param name="testAssembly">The assembly.</param>
        /// <param name="diagnosticMessageSink">The message sink used to send diagnostic messages</param>
        public CollectionPerAssemblyTestCollectionFactory(ITestAssembly testAssembly, IMessageSink diagnosticMessageSink)
        {
            this.testAssembly = testAssembly;

            defaultCollection = new TestCollection(testAssembly, null, "Test collection for " + Path.GetFileName(testAssembly.Assembly.AssemblyPath));
            collectionDefinitions = TestCollectionFactoryHelper.GetTestCollectionDefinitions(testAssembly.Assembly, diagnosticMessageSink);
        }
コード例 #16
0
ファイル: MainForm.cs プロジェクト: ManfredLange/csUnit
        private void OnAssemblyRemoving(object sender, AssemblyEventArgs args)
        {
            ITestAssembly ta = RecipeFactory.Current[args.AssemblyFullName];

            UnhookAssembly(ta);
            UpdateFormTitle();
        }
コード例 #17
0
 TestableXunitTestAssemblyRunner(ITestAssembly testAssembly,
                                 IEnumerable <IXunitTestCase> testCases,
                                 IMessageSink messageSink,
                                 ITestFrameworkOptions executionOptions)
     : base(testAssembly, testCases, messageSink, executionOptions)
 {
 }
コード例 #18
0
        private void CreateNodesFor(ITestAssembly ta, int assemblyNodePosition)
        {
            TestFixtureInfoCollection tests = ta.TestFixtureInfos;
            SmartTreeNode             root  = CreateOrFindAssemblyNode(ta, assemblyNodePosition);

            foreach (TestFixtureInfo tf in tests)
            {
                SmartTreeNode classNode = CreateOrFindClassNode(ta, root.Nodes,
                                                                tf.FullName.Split(new char[] { '.', '+' }), 0);
                classNode.Tag        = new UiElementInfo(ta, tf, null);
                classNode.ImageIndex = 2;
                foreach (TestMethodInfo tm in tf.TestMethods)
                {
                    SmartTreeNode methodNode = CreateOrFindMethodNode(classNode.Nodes, tm);
                    methodNode.Tag = new UiElementInfo(ta, tf, tm);
                }
            }
            TreeViewEventHandler temp = AfterSelect;

            AfterSelect = null;
            try {
                RestoreCheckState(root);
                SetCheckedStatus(_treeTestHierarchy.Nodes);
            }
            finally {
                AfterSelect = temp;
            }
            if (_config.AutoExpandTestHierarchy)
            {
                root.ExpandAll();
            }
        }
コード例 #19
0
ファイル: Recipe.cs プロジェクト: ManfredLange/csUnit
 private void HookupAssembly(ITestAssembly addedTestAssembly)
 {
     addedTestAssembly.AssemblyFinished += _onAssemblyFinished;
     addedTestAssembly.TestsAborted     += _onTestsAborted;
     addedTestAssembly.AssemblyChanged  += AddedTestAssemblyAssemblyChanged;
     InvalidateTestCount();
 }
コード例 #20
0
        /// <summary>
        /// Initializes a new instance of the <see cref="CollectionPerAssemblyTestCollectionFactory" /> class.
        /// </summary>
        /// <param name="testAssembly">The assembly.</param>
        /// <param name="diagnosticMessageSink">The message sink used to send diagnostic messages</param>
        public CollectionPerAssemblyTestCollectionFactory(ITestAssembly testAssembly, IMessageSink diagnosticMessageSink)
        {
            this.testAssembly = testAssembly;

            defaultCollection     = new TestCollection(testAssembly, null, "Test collection for " + Path.GetFileName(testAssembly.Assembly.AssemblyPath));
            collectionDefinitions = TestCollectionFactoryHelper.GetTestCollectionDefinitions(testAssembly.Assembly, diagnosticMessageSink);
        }
 public XunitTestAssemblyRunnerWithAssemblyFixture(ITestAssembly testAssembly,
                                                   IEnumerable<IXunitTestCase> testCases,
                                                   IMessageSink diagnosticMessageSink,
                                                   IMessageSink executionMessageSink,
                                                   ITestFrameworkExecutionOptions executionOptions)
     : base(testAssembly, testCases, diagnosticMessageSink, executionMessageSink, executionOptions)
 { }
コード例 #22
0
        private static SmartTreeNode CreateOrFindClassNode(ITestAssembly ta, SmartTreeNodeCollection nodes,
                                                           string[] classFullNameParts, int index)
        {
            foreach (SmartTreeNode node in nodes)
            {
                if (node.Text == classFullNameParts[index])
                {
                    index++;
                    if (index < classFullNameParts.Length)
                    {
                        return(CreateOrFindClassNode(ta, node.Nodes, classFullNameParts, index));
                    }
                    else
                    {
                        return(node);
                    }
                }
            }
            SmartTreeNode newNode = new SmartTreeNode(classFullNameParts[index]);

            newNode.ImageIndex = 1;
            newNode.Tag        = new UiElementInfo(ta, new TestSuite(classFullNameParts, index));
            nodes.Add(newNode);
            while (++index < classFullNameParts.Length)
            {
                SmartTreeNode child = new SmartTreeNode(classFullNameParts[index]);
                child.ImageIndex = 1;
                child.Tag        = new UiElementInfo(ta, new TestSuite(classFullNameParts, index));
                newNode.Nodes.Add(child);
                newNode = child;
            }
            newNode.ImageIndex = 2;
            newNode.Tag        = null;
            return(newNode);
        }
コード例 #23
0
 public TestAssemblyRunner(ITestAssembly testAssembly, IEnumerable <IXunitTestCase> testCases, IMessageSink diagnosticMessageSink, IMessageSink executionMessageSink, ITestFrameworkExecutionOptions executionOptions, TestCaseDeserializerArgs testCaseDeserializerArgs)
     : base(testAssembly, testCases, diagnosticMessageSink, executionMessageSink, executionOptions)
 {
     _testCaseDeserializerArgs = testCaseDeserializerArgs;
     _messageSyncWithEvents    = new MessageSinkWithEvents(executionMessageSink, diagnosticMessageSink);
     ExecutionMessageSink      = _messageSyncWithEvents; // the ExecutionMessageSink is used to create the base message bus
 }
 public XunitTestAssemblyRunnerWithAssemblyFixture(ITestAssembly testAssembly,
                                                   IEnumerable<IXunitTestCase> testCases,
                                                   IMessageSink diagnosticMessageSink,
                                                   IMessageSink executionMessageSink,
                                                   ITestFrameworkExecutionOptions executionOptions)
     : base(testAssembly, testCases, diagnosticMessageSink, executionMessageSink, executionOptions)
 { }
 public DependencyInjectionTestAssemblyRunner(IServiceProvider provider,
                                              ITestAssembly testAssembly,
                                              IEnumerable <IXunitTestCase> testCases,
                                              IMessageSink diagnosticMessageSink,
                                              IMessageSink executionMessageSink,
                                              ITestFrameworkExecutionOptions executionOptions)
     : base(testAssembly, testCases, diagnosticMessageSink,
            executionMessageSink, executionOptions) =>
コード例 #26
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TestAssemblyCleanupFailure"/> class.
 /// </summary>
 public TestAssemblyCleanupFailure(IEnumerable <ITestCase> testCases, ITestAssembly testAssembly, string[] exceptionTypes, string[] messages, string[] stackTraces, int[] exceptionParentIndices)
     : base(testCases, testAssembly)
 {
     StackTraces            = stackTraces;
     Messages               = messages;
     ExceptionTypes         = exceptionTypes;
     ExceptionParentIndices = exceptionParentIndices;
 }
コード例 #27
0
 private void UnhookAssembly(ITestAssembly ta)
 {
     ta.AssemblyChanged -= _onAssemblyChanged;
     ta.TestPassed      -= _testPassed;
     ta.TestFailed      -= _testFailed;
     ta.TestError       -= _testError;
     ta.TestSkipped     -= _testSkipped;
 }
 public ScenarioReportingXunitTestAssemblyRunner(ITestAssembly testAssembly,
                                                 IEnumerable <IXunitTestCase> testCases,
                                                 IMessageSink diagnosticMessageSink,
                                                 IMessageSink executionMessageSink,
                                                 ITestFrameworkExecutionOptions executionOptions)
     : base(testAssembly, testCases, diagnosticMessageSink, executionMessageSink, executionOptions)
 {
 }
コード例 #29
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TestAssemblyCleanupFailure"/> class.
 /// </summary>
 public TestAssemblyCleanupFailure(IEnumerable<ITestCase> testCases, ITestAssembly testAssembly, string[] exceptionTypes, string[] messages, string[] stackTraces, int[] exceptionParentIndices)
     : base(testCases, testAssembly)
 {
     StackTraces = stackTraces;
     Messages = messages;
     ExceptionTypes = exceptionTypes;
     ExceptionParentIndices = exceptionParentIndices;
 }
コード例 #30
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TestAssemblyFinished"/> class.
 /// </summary>
 public TestAssemblyFinished(IEnumerable<ITestCase> testCases, ITestAssembly testAssembly, decimal executionTime, int testsRun, int testsFailed, int testsSkipped)
     : base(testCases, testAssembly)
 {
     TestsSkipped = testsSkipped;
     TestsFailed = testsFailed;
     TestsRun = testsRun;
     ExecutionTime = executionTime;
 }
コード例 #31
0
        private void OnAssemblyAdded(object sender, AssemblyEventArgs args)
        {
            ITestAssembly ta = RecipeFactory.Current[args.AssemblyFullName];

            HookupAssembly(ta);
            Reset();
            ResetCounters();
        }
コード例 #32
0
 private void HookupAssembly(ITestAssembly ta)
 {
     ta.AssemblyChanged += _onAssemblyChanged;
     ta.TestPassed      += _testPassed;
     ta.TestFailed      += _testFailed;
     ta.TestError       += _testError;
     ta.TestSkipped     += _testSkipped;
 }
コード例 #33
0
        private void OnAssemblyChangedAsync(object sender, AssemblyEventArgs args)
        {
            ITestAssembly ta           = RecipeFactory.Current[args.PathFileName];
            int           nodePosition = _treeTestHierarchy.Nodes.IndexOf(FindAssemblyNode(ta));

            RemoveNodesFor(ta);
            CreateNodesFor(ta, nodePosition);
        }
コード例 #34
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TestAssemblyFinished"/> class.
 /// </summary>
 public TestAssemblyFinished(IEnumerable <ITestCase> testCases, ITestAssembly testAssembly, decimal executionTime, int testsRun, int testsFailed, int testsSkipped)
     : base(testCases, testAssembly)
 {
     TestsSkipped  = testsSkipped;
     TestsFailed   = testsFailed;
     TestsRun      = testsRun;
     ExecutionTime = executionTime;
 }
コード例 #35
0
 /// <summary>
 /// Initializes a new instance of the <see cref="T:Xunit.Sdk.XunitTestAssemblyRunner"/> class.
 /// </summary>
 /// <param name="testAssembly">The assembly that contains the tests to be run.</param><param name="testCases">The test cases to be run.</param><param name="diagnosticMessageSink">The message sink to report diagnostic messages to.</param><param name="executionMessageSink">The message sink to report run status to.</param><param name="executionOptions">The user's requested execution options.</param>
 public BrowserTestAssemblyRunner(ITestAssembly testAssembly, IEnumerable<IXunitTestCase> testCases, IMessageSink diagnosticMessageSink, IMessageSink executionMessageSink, ITestFrameworkExecutionOptions executionOptions)
     : base(testAssembly, testCases.Cast<BrowserTestCase>().ToList(), diagnosticMessageSink, executionMessageSink, executionOptions)
 {
     BeforeAfterHandlers =
         testAssembly.Assembly.GetCustomAttributes(typeof(BeforeAfterAssemblyTestsAttribute))
             .Select(attributeInfo => attributeInfo.GetNamedArgument<Type>("HandlerType"))
             .Select(handlerType => ExtensibilityPointFactory.Get<IBeforeAfterAssemblyTests>(diagnosticMessageSink, handlerType))
             .ToList();
 }
コード例 #36
0
 TestableXunitTestAssemblyRunner(ITestAssembly testAssembly,
                                 IEnumerable <IXunitTestCase> testCases,
                                 List <IMessageSinkMessage> diagnosticMessages,
                                 IMessageSink executionMessageSink,
                                 ITestFrameworkExecutionOptions executionOptions)
     : base(testAssembly, testCases, SpyMessageSink.Create(messages: diagnosticMessages), executionMessageSink, executionOptions)
 {
     DiagnosticMessages = diagnosticMessages;
 }
コード例 #37
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TestAssemblyCleanupFailure"/> class.
 /// </summary>
 public TestAssemblyCleanupFailure(IEnumerable<ITestCase> testCases, ITestAssembly testAssembly, Exception ex)
     : base(testCases, testAssembly)
 {
     var failureInfo = ExceptionUtility.ConvertExceptionToFailureInformation(ex);
     ExceptionTypes = failureInfo.ExceptionTypes;
     Messages = failureInfo.Messages;
     StackTraces = failureInfo.StackTraces;
     ExceptionParentIndices = failureInfo.ExceptionParentIndices;
 }
コード例 #38
0
        internal TestCollection(ITestAssembly testAssembly, ITypeInfo collectionDefinition, string displayName, Guid uniqueId)
        {
            Guard.ArgumentNotNull("testAssembly", testAssembly);

            CollectionDefinition = collectionDefinition;
            DisplayName          = displayName;
            TestAssembly         = testAssembly;
            UniqueID             = uniqueId;
        }
コード例 #39
0
ファイル: TestCollection.cs プロジェクト: ansarisamer/xunit
        /// <summary>
        /// Initializes a new instance of the <see cref="TestCollection"/> class.
        /// </summary>
        /// <param name="testAssembly">The test assembly the collection belongs to</param>
        /// <param name="collectionDefinition">The optional type which contains the collection definition</param>
        /// <param name="displayName">The display name for the test collection</param>
        public TestCollection(ITestAssembly testAssembly, ITypeInfo collectionDefinition, string displayName)
        {
            Guard.ArgumentNotNull("testAssembly", testAssembly);

            CollectionDefinition = collectionDefinition;
            DisplayName = displayName;
            TestAssembly = testAssembly;
            UniqueID = Guid.NewGuid();
        }
コード例 #40
0
 public ObservationAssemblyRunner(ITestAssembly testAssembly,
                                  IEnumerable<IXunitTestCase> testCases,
                                  IMessageSink diagnosticMessageSink,
                                  IMessageSink executionMessageSink,
                                  ITestFrameworkExecutionOptions executionOptions)
     : base(testAssembly, testCases, diagnosticMessageSink, executionMessageSink, executionOptions)
 {
     TestCaseOrderer = new ObservationTestCaseOrderer();
 }
コード例 #41
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TestCollection"/> class.
        /// </summary>
        /// <param name="testAssembly">The test assembly the collection belongs to</param>
        /// <param name="collectionDefinition">The optional type which contains the collection definition</param>
        /// <param name="displayName">The display name for the test collection</param>
        public TestCollection(ITestAssembly testAssembly, ITypeInfo collectionDefinition, string displayName)
        {
            Guard.ArgumentNotNull("testAssembly", testAssembly);

            CollectionDefinition = collectionDefinition;
            DisplayName          = displayName;
            TestAssembly         = testAssembly;
            UniqueID             = Guid.NewGuid();
        }
コード例 #42
0
        private void OnAssemblyRemoving(object sender, AssemblyEventArgs args)
        {
            ITestAssembly ta = RecipeFactory.Current[args.AssemblyFullName];

            UnhookAssembly(ta);
            ClearAssemblySelections(ta);
            Reset();
            ResetCounters();
        }
コード例 #43
0
ファイル: UIElementInfo.cs プロジェクト: ManfredLange/csUnit
 public UiElementInfo(ITestAssembly ta, ITestFixtureInfo tf, ITestMethodInfo tm) {
    if (ta != null) {
       _assemblyName = ta.Name.FullName.Split(",".ToCharArray())[0];
       _assemblyPathName = ta.Name.CodeBase;
    }
    _fixtureFullName = string.Empty;
    _methodName = string.Empty;
    if( tf != null ) {
       _fixtureFullName = tf.FullName;
       if( tm != null ) {
          _methodName = tm.Name;
          _methodFullName = tm.FullName;
       }
    }
 }
コード例 #44
0
ファイル: Recipe.cs プロジェクト: ManfredLange/csUnit
 private void RunTests(ITestAssembly testAssembly, ITestRun testRun) {
    if( testAssembly != null ) {
       try {
          //testAssembly.Refresh();
          testAssembly.RunTests(testRun);
       }
       catch( Exception ex ) {
          // Invoke the abort event b/c an exception that goes unhandled 
          // here is the equivalent of an aborted recipe.
          var recipeEventArgs = new RecipeEventArgs(ex.Message);
          TestsRunning = false;
          if( Aborted != null ) {
             Aborted(this, recipeEventArgs);
          }
       }
    }
 }
コード例 #45
0
 public MyTestCollectionFactory(ITestAssembly assembly)
 {
     Assembly = assembly;
 }
コード例 #46
0
ファイル: MainForm.cs プロジェクト: ManfredLange/csUnit
 private void HookupAssembly(ITestAssembly ta) {
    ta.TestStarted += _testStarted;
    ta.TestFailed  += _testFailed;
    ta.TestError   += _testError;
    ta.TestSkipped += _testSkipped;
    ta.TestPassed  += _testPassed;
    ta.AssemblyChanged     += _assemblyChanged;
 }
コード例 #47
0
        public static TestableXunitTestAssemblyRunner Create(ITestAssembly assembly = null,
                                                             IXunitTestCase[] testCases = null,
                                                             ITestFrameworkOptions options = null)
        {
            if (testCases == null)
                testCases = new[] { Mocks.XunitTestCase<ClassUnderTest>("Passing") };

            return new TestableXunitTestAssemblyRunner(
                assembly ?? testCases.First().TestMethod.TestClass.TestCollection.TestAssembly,
                testCases ?? new IXunitTestCase[0],
                SpyMessageSink.Create(),
                options ?? new TestFrameworkOptions()
            );
        }
コード例 #48
0
 TestableXunitTestAssemblyRunner(ITestAssembly testAssembly,
                                 IEnumerable<IXunitTestCase> testCases,
                                 IMessageSink messageSink,
                                 ITestFrameworkOptions executionOptions)
     : base(testAssembly, testCases, messageSink, executionOptions) { }
コード例 #49
0
        /// <summary>
        /// Initializes a new instance of the <see cref="CollectionPerClassTestCollectionFactory" /> class.
        /// </summary>
        /// <param name="testAssembly">The assembly info.</param>
        /// <param name="diagnosticMessageSink">The message sink used to send diagnostic messages</param>
        public CollectionPerClassTestCollectionFactory(ITestAssembly testAssembly, IMessageSink diagnosticMessageSink)
        {
            this.testAssembly = testAssembly;

            collectionDefinitions = TestCollectionFactoryHelper.GetTestCollectionDefinitions(testAssembly.Assembly, diagnosticMessageSink);
        }
コード例 #50
0
ファイル: UIElementInfo.cs プロジェクト: ManfredLange/csUnit
 public UiElementInfo(ITestAssembly ta, TestSuite ts) {
    _assemblyName = ta.Name.FullName.Split(",".ToCharArray())[0];
    _assemblyPathName = ta.Name.CodeBase;
    _fixtureFullName = ts.FullName;
    _methodName = string.Empty;
 }
コード例 #51
0
        /// <summary>
        /// Initializes a new instance of the <see cref="CollectionPerClassTestCollectionFactory" /> class.
        /// </summary>
        /// <param name="testAssembly">The assembly info.</param>
        /// <param name="messageAggregator">The message aggregator used to report <see cref="EnvironmentalWarning"/> messages.</param>
        public CollectionPerClassTestCollectionFactory(ITestAssembly testAssembly, IMessageAggregator messageAggregator)
        {
            this.testAssembly = testAssembly;

            collectionDefinitions = TestCollectionFactoryHelper.GetTestCollectionDefinitions(testAssembly.Assembly, messageAggregator);
        }
コード例 #52
0
ファイル: Recipe.cs プロジェクト: ManfredLange/csUnit
 private void HookupAssembly(ITestAssembly addedTestAssembly) {
    addedTestAssembly.AssemblyFinished += _onAssemblyFinished;
    addedTestAssembly.TestsAborted += _onTestsAborted;
    addedTestAssembly.AssemblyChanged += AddedTestAssemblyAssemblyChanged;
    InvalidateTestCount();
 }
コード例 #53
0
 private void UnhookTestAssembly(ITestAssembly ta) {
    ta.TestError -= _onTestEvent;
    ta.TestFailed -= _onTestEvent;
    ta.TestPassed -= _onTestEvent;
 }
コード例 #54
0
ファイル: Recipe.cs プロジェクト: ManfredLange/csUnit
 private void UnhookAssembly(ITestAssembly testAssembly) {
    testAssembly.AssemblyFinished -= _onAssemblyFinished;
    testAssembly.TestsAborted -= _onTestsAborted;
    InvalidateTestCount();
 }
コード例 #55
0
 private void HookupAssembly(ITestAssembly assembly) {
    assembly.TestError += _onTestErrorOrFail;
    assembly.TestFailed += _onTestErrorOrFail;
 }
コード例 #56
0
ファイル: MainForm.cs プロジェクト: ManfredLange/csUnit
 private void UnhookAssembly(ITestAssembly ta) {
    ta.TestStarted -= _testStarted;
    ta.TestFailed  -= _testFailed;
    ta.TestError   -= _testError;
    ta.TestSkipped -= _testSkipped;
    ta.TestPassed  -= _testPassed;
    ta.AssemblyChanged     -= _assemblyChanged;
 }
コード例 #57
0
ファイル: Recipe.cs プロジェクト: ManfredLange/csUnit
      internal void AddAssembly(ITestAssembly addedTestAssembly) {
         addedTestAssembly.SetConsoleOutputTo(_twConsole);

         HookupAssembly(addedTestAssembly);

         _testAssemblies.Add(addedTestAssembly);
         IsModified = true;

         if(addedTestAssembly.Name.FullName != string.Empty) {
            if(AssemblyAdded != null) {
               AssemblyAdded(this,
                  new AssemblyEventArgs(addedTestAssembly.Name.FullName,
                     addedTestAssembly.Name.CodeBase));
            }
         }
      }
コード例 #58
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CollectionPerAssemblyTestCollectionFactory" /> class.
 /// </summary>
 /// <param name="testAssembly">The assembly.</param>
 public CollectionPerAssemblyTestCollectionFactory(ITestAssembly testAssembly)
     : this(testAssembly, MessageAggregator.Instance) { }
コード例 #59
0
 private void HookupTestAssembly(ITestAssembly ta) {
    ta.TestError += _onTestEvent;
    ta.TestFailed += _onTestEvent;
    ta.TestPassed += _onTestEvent;
 }
コード例 #60
0
ファイル: TestAssemblyMessage.cs プロジェクト: modai888/xunit
 /// <summary>
 /// Initializes a new instance of the <see cref="TestAssemblyMessage"/> class.
 /// </summary>
 internal TestAssemblyMessage(ITestCase testCase, ITestAssembly testAssembly)
 {
     TestAssembly = testAssembly;
     TestCases = new ITestCase[] { testCase };
 }