コード例 #1
0
ファイル: SuiteBuilderTests.cs プロジェクト: wsgan001/asegrp
        public void LoadAssembly()
        {
            Test suite = builder.Build(new TestPackage(testsDll));

            Assert.IsNotNull(suite, "Unable to build suite");
            Assert.AreEqual(1, suite.Tests.Count);
            Assert.AreEqual("NUnit", ((ITest)suite.Tests[0]).TestName.Name);
        }
コード例 #2
0
        private void runSchemaValidatorTest(TextWriter writer, CultureInfo testCulture)
        {
            // Preserve current culture
            CultureInfo previousCulture = Thread.CurrentThread.CurrentCulture;

            // Enable test culture
            Thread.CurrentThread.CurrentCulture = testCulture;

            try
            {
                string           testsDll = "mock-assembly.dll";
                TestSuiteBuilder builder  = new TestSuiteBuilder();
                Test             suite    = builder.Build(new TestPackage(testsDll));

                TestResult result = suite.Run(NullListener.NULL);

                XmlResultVisitor visitor = new XmlResultVisitor(writer, result);
                result.Accept(visitor);
                visitor.Write();
            }
            finally
            {
                // Restore previous culture
                Thread.CurrentThread.CurrentCulture = previousCulture;
            }
        }
コード例 #3
0
        private void runSchemaValidatorTest(string reportFileName, CultureInfo testCulture)
        {
            // Preserve current culture
            CultureInfo previousCulture = Thread.CurrentThread.CurrentCulture;

            // Enable test culture
            Thread.CurrentThread.CurrentCulture = testCulture;

            try
            {
                string           testsDll = "mock-assembly.dll";
                TestSuiteBuilder builder  = new TestSuiteBuilder();
                Test             suite    = builder.Build(new TestPackage(testsDll));

                TestResult result = suite.Run(NullListener.NULL);

                XmlResultVisitor visitor = new XmlResultVisitor(reportFileName, result);
                result.Accept(visitor);
                visitor.Write();

                SchemaValidator validator = new SchemaValidator(reportFileName, schemaFile.Path);
                Assert.IsTrue(validator.Validate(), "validate failed");
            }
            finally
            {
                // Restore previous culture
                Thread.CurrentThread.CurrentCulture = previousCulture;
            }
        }
コード例 #4
0
        public void Hierarchy()
        {
            TestSuiteBuilder builder = new TestSuiteBuilder();
            Test             suite   = builder.Build(new TestPackage(testsDll));

            suite = (Test)suite.Tests[0];
            Assert.AreEqual("NUnit", suite.TestName.Name);

            suite = (Test)suite.Tests[0];
            Assert.AreEqual("Tests", suite.TestName.Name);
            Assert.AreEqual(MockAssembly.Fixtures, suite.Tests.Count);

            Test singletonSuite = TestFinder.Find("Singletons", suite, false);

            Assert.AreEqual(1, singletonSuite.Tests.Count);

            Test mockSuite = TestFinder.Find("Assemblies", suite, false);

            Assert.AreEqual(1, mockSuite.Tests.Count);

            Test mockFixtureSuite = TestFinder.Find("MockTestFixture", mockSuite, false);

            Assert.AreEqual(MockTestFixture.Tests, mockFixtureSuite.Tests.Count);

            foreach (Test t in mockFixtureSuite.Tests)
            {
                Assert.IsFalse(t.IsSuite, "Should not be a suite");
            }
        }
コード例 #5
0
ファイル: AssemblyTests.cs プロジェクト: scottwis/eddie
 public void LoadAssembly()
 {
     TestSuiteBuilder builder = new TestSuiteBuilder();
     Test suite = builder.Build( new TestPackage( thisDll ) );
     Assert.IsNotNull(suite, "Unable to load " + thisDll);
     Assert.IsTrue( File.Exists( thisDll ), "Load does not set current Directory" );
 }
コード例 #6
0
        public void LoadTestFixtureFromAssembly()
        {
            TestSuiteBuilder builder = new TestSuiteBuilder();
            TestSuite        suite   = builder.Build(testsDll, "NUnit.Tests.Assemblies.MockTestFixture");

            Assert.IsNotNull(suite);
        }
コード例 #7
0
        public void TestRoot()
        {
            TestSuiteBuilder builder = new TestSuiteBuilder();
            Test             suite   = builder.Build(new TestPackage(testsDll));

            Assert.AreEqual(testsDll, suite.TestName.Name);
        }
コード例 #8
0
ファイル: NUnitTestLoader.cs プロジェクト: synnos/testagent
        public TestCollection[] LoadTests(string filename)
        {
            var results = new List <TestCollection>();
            var package = new TestPackage(filename);

            CoreExtensions.Host.InitializeService();

            var builder = new TestSuiteBuilder();

            var suite = builder.Build(package);

            foreach (object test in suite.Tests)
            {
                var testSuite = test as TestSuite;
                if (testSuite == null)
                {
                    continue;
                }
                results.AddRange(GetSteps(testSuite));
            }

            CoreExtensions.Host.UnloadService();

            return(results.ToArray());
        }
コード例 #9
0
        public void LoadTestFixtureFromAssembly()
        {
            TestSuiteBuilder builder = new TestSuiteBuilder();
            TestSuite        suite   = builder.Build(testsDll, "NUnit.Tests.Assemblies.AssemblyTests");

            Assert.IsNotNull(suite, "Should not be Null");
        }
コード例 #10
0
        public void NamespaceSetUpFixtureReplacesNamespaceNodeInTree()
        {
            string nameSpace = "NUnit.TestData.SetupFixture.Namespace1";
            TestSuiteBuilder builder = new TestSuiteBuilder();
            TestPackage package = new TestPackage( testAssembly );
            package.TestName = nameSpace;
            Test suite= builder.Build( package );

            Assert.IsNotNull(suite);

            Assert.AreEqual(testAssembly, suite.TestName.Name);
            Assert.AreEqual(1, suite.Tests.Count);

            string[] nameSpaceBits = nameSpace.Split('.');
            for (int i = 0; i < nameSpaceBits.Length; i++)
            {
                suite = suite.Tests[0] as TestSuite;
                Assert.AreEqual(nameSpaceBits[i], suite.TestName.Name);
                Assert.AreEqual(1, suite.Tests.Count);
            }

            Assert.IsInstanceOf(typeof(SetUpFixture), suite);

            suite = suite.Tests[0] as TestSuite;
            Assert.AreEqual("SomeTestFixture", suite.TestName.Name);
            Assert.AreEqual(1, suite.Tests.Count);
        }
コード例 #11
0
        [SetUp] public void LoadFixture()
        {
            string           testsDll = "nunit.tests.dll";
            TestSuiteBuilder builder  = new TestSuiteBuilder();

            suite = builder.Build(testsDll, "NUnit.Tests.Core.TestFixtureExtension+DerivedTestFixture");
        }
コード例 #12
0
        /// <summary>
        /// Overridden function that gets called when the plugin is loaded. Registers all creator plugins
        /// </summary>
        /// <returns></returns>
        public override bool InitPluginModule()
        {
            EDITOR_PLUGIN_INFO.NativePluginNames = new string[] { "Havok" };
            HavokManaged.ManagedModule.InitManagedModule();

            StaticMeshShape.UsesCollisionGroups = true; // switch to displaying collision groups

            // register shape classes
            creators = new IShapeCreatorPlugin[]
            {
                new HavokConstraintShapeCreator(),
                new HavokConstraintChainShapeCreator(),
                new HavokResourceShapeCreator()
            };

            foreach (IShapeCreatorPlugin plugin in creators)
            {
                EditorManager.ShapeCreatorPlugins.Add(plugin);
            }

            // create and activate panel
            _panel = new HavokPhysicsPanel(EditorManager.ApplicationLayout.DockingArea);
            _panel.ShowDockable();

            // Register automated tests
            TestSuiteBuilder testBuilder = new TestSuiteBuilder();
            TestSuite        testSuite   = testBuilder.Build(typeof(EditorPlugin).Assembly.FullName);

            TestManager.AddTestSuite(testSuite);

            IProject.ProjectUnloaded += new EventHandler(IProject_ProjectUnloaded);

            return(true);
        }
コード例 #13
0
        public void NamespaceSetUpFixtureReplacesNamespaceNodeInTree()
        {
            string           nameSpace = "NUnit.TestData.SetupFixture.Namespace1";
            TestSuiteBuilder builder   = new TestSuiteBuilder();
            TestPackage      package   = new TestPackage(testAssembly);

            package.TestName = nameSpace;
            Test suite = builder.Build(package);

            Assert.IsNotNull(suite);

            Assert.AreEqual(testAssembly, suite.TestName.Name);
            Assert.AreEqual(1, suite.Tests.Count);

            string[] nameSpaceBits = nameSpace.Split('.');
            for (int i = 0; i < nameSpaceBits.Length; i++)
            {
                suite = suite.Tests[0] as TestSuite;
                Assert.AreEqual(nameSpaceBits[i], suite.TestName.Name);
                Assert.AreEqual(1, suite.Tests.Count);
            }

            Assert.IsInstanceOfType(typeof(SetUpFixture), suite);

            suite = suite.Tests[0] as TestSuite;
            Assert.AreEqual("SomeTestFixture", suite.TestName.Name);
            Assert.AreEqual(1, suite.Tests.Count);
        }
コード例 #14
0
		[SetUp] public void LoadFixture()
		{
            string testsDll = AssemblyHelper.GetAssemblyPath(typeof(DerivedTestFixture));
			TestSuiteBuilder builder = new TestSuiteBuilder();
			TestPackage package = new TestPackage( testsDll );
			package.TestName = typeof(DerivedTestFixture).FullName;
			suite= builder.Build( package );
		}
コード例 #15
0
        public void Setup()
        {
            TestSuiteBuilder builder = new TestSuiteBuilder();
            TestPackage package = new TestPackage(AssemblyHelper.GetAssemblyPath(typeof(ActionAttributeExceptionFixture)));
            package.TestName = typeof(ActionAttributeExceptionFixture).Namespace;

            _Suite = builder.Build(package);
        }
コード例 #16
0
        public void CanAddAllAvailableCategoriesInTestTree()
        {
            TestSuiteBuilder builder = new TestSuiteBuilder();
            Test             suite   = builder.Build(new TestPackage("mock-assembly.dll"));

            categoryManager.AddAllCategories(suite);
            Assert.AreEqual(MockAssembly.Categories, categoryManager.Categories.Count);
        }
コード例 #17
0
        private TestResult runTests(string nameSpace, TestFilter filter)
        {
            TestSuiteBuilder builder = new TestSuiteBuilder();
			TestPackage package = new TestPackage( testAssembly );
			package.TestName = nameSpace;
            Test suite = builder.Build( package );
            return suite.Run(new NullListener(),filter);
        }
コード例 #18
0
		[SetUp] public void LoadFixture()
		{
			string testsDll = "test-assembly.dll";
			TestSuiteBuilder builder = new TestSuiteBuilder();
			TestPackage package = new TestPackage( testsDll );
			package.TestName = "NUnit.TestData.TestFixtureExtension.DerivedTestFixture";
			suite= builder.Build( package );
		}
コード例 #19
0
        private TestSuite LoadFixture(string fixtureName)
        {
            TestSuite suite = builder.Build(testsDll, fixtureName);

            Assert.IsNotNull(suite);

            return(suite);
        }
コード例 #20
0
        public void SetUp()
        {
            TestSuiteBuilder builder = new TestSuiteBuilder();

            suite = builder.Build(new TestPackage(testsDll));

            treeView = new TestSuiteTreeView();
        }
コード例 #21
0
ファイル: AssemblyTests.cs プロジェクト: scottwis/eddie
 public void LoadTestFixtureFromAssembly()
 {
     TestSuiteBuilder builder = new TestSuiteBuilder();
     TestPackage package = new TestPackage( thisDll );
     package.TestName = this.GetType().FullName;
     Test suite= builder.Build( package );
     Assert.IsNotNull(suite, "Should not be Null");
 }
コード例 #22
0
ファイル: AssemblyTests.cs プロジェクト: scottwis/eddie
 public void LoadAssemblyWithoutTestFixtures()
 {
     TestSuiteBuilder builder = new TestSuiteBuilder();
     Test suite = builder.Build( new TestPackage( noTestFixturesDll ) );
     Assert.IsNotNull(suite, "Unable to load " + noTestFixturesDll);
     Assert.AreEqual(RunState.Runnable, suite.RunState);
     Assert.AreEqual( 0, suite.Tests.Count );
 }
コード例 #23
0
        public void LoadAssembly()
        {
            TestSuiteBuilder builder = new TestSuiteBuilder();
            Test             suite   = builder.Build(new TestPackage(thisDll));

            Assert.IsNotNull(suite, "Unable to load " + thisDll);
            Assert.IsTrue(File.Exists(thisDll), "Load does not set current Directory");
        }
コード例 #24
0
ファイル: TestUtility.cs プロジェクト: markstiles/TestStar
        public static TestSuite GetTestSuite(string assemblyName)
        {
            TestSuiteBuilder builder     = new TestSuiteBuilder();
            string           packagePath = string.Format(@"{0}\{1}.dll", Constants.ExecutionRoot, assemblyName);
            TestPackage      testPackage = new TestPackage(packagePath);
            TestSuite        suite       = builder.Build(testPackage);

            return(suite);
        }
コード例 #25
0
        [SetUp] public void LoadFixture()
        {
            string           testsDll = AssemblyHelper.GetAssemblyPath(typeof(DerivedTestFixture));
            TestSuiteBuilder builder  = new TestSuiteBuilder();
            TestPackage      package  = new TestPackage(testsDll);

            package.TestName = typeof(DerivedTestFixture).FullName;
            suite            = builder.Build(package);
        }
コード例 #26
0
        public void LoadAssemblyWithoutTestFixtures()
        {
            TestSuiteBuilder builder = new TestSuiteBuilder();
            Test             suite   = builder.Build(new TestPackage(noTestFixturesDll));

            Assert.IsNotNull(suite, "Unable to load " + noTestFixturesDll);
            Assert.AreEqual(RunState.Runnable, suite.RunState);
            Assert.AreEqual(0, suite.Tests.Count);
        }
コード例 #27
0
        public void Setup()
        {
            TestSuiteBuilder builder = new TestSuiteBuilder();
            TestPackage      package = new TestPackage(AssemblyHelper.GetAssemblyPath(typeof(ActionAttributeExceptionFixture)));

            package.TestName = typeof(ActionAttributeExceptionFixture).Namespace;

            _Suite = builder.Build(package);
        }
コード例 #28
0
        [SetUp] public void LoadFixture()
        {
            string           testsDll = "test-assembly.dll";
            TestSuiteBuilder builder  = new TestSuiteBuilder();
            TestPackage      package  = new TestPackage(testsDll);

            package.TestName = "NUnit.TestData.TestFixtureExtension.DerivedTestFixture";
            suite            = builder.Build(package);
        }
コード例 #29
0
        private void runSchemaValidatorTest(TextWriter writer)
        {
            string           testsDll = NUnit.Tests.Assemblies.MockAssembly.AssemblyPath;
            TestSuiteBuilder builder  = new TestSuiteBuilder();
            Test             suite    = builder.Build(new TestPackage(testsDll));

            TestResult result = suite.Run(NullListener.NULL, TestFilter.Empty);

            new XmlResultWriter(writer).SaveTestResult(result);
        }
コード例 #30
0
ファイル: AssemblyTests.cs プロジェクト: taoxiease/asegrp
 public void LoadAssemblyWithoutTestFixtures()
 {
     string fileName = "notestfixtures-assembly.dll";
     TestSuiteBuilder builder = new TestSuiteBuilder();
     Test suite = builder.Build( new TestPackage( fileName ) );
     Assert.IsNotNull( suite,"Should not be null" );
     Assert.AreEqual( RunState.NotRunnable, suite.RunState );
     Assert.AreEqual( suite.IgnoreReason, "Has no TestFixtures" );
     Assert.AreEqual( 0, suite.Tests.Count );
 }
コード例 #31
0
ファイル: SamplesTester.cs プロジェクト: dgg/NMoneys.Web
        private TestResult test(CompilerResults results)
        {
            CoreExtensions.Host.InitializeService();
            var        package = new TestPackage(results.PathToAssembly);
            var        builder = new TestSuiteBuilder();
            TestSuite  suite   = builder.Build(package);
            TestResult test    = suite.Run(NullListener.NULL, TestFilter.Empty);

            return(test);
        }
コード例 #32
0
        public void LoadFixture()
        {
            TestPackage package = new TestPackage("Multiple Assemblies", assemblies);

            package.TestName = "NUnit.Tests.Assemblies.MockTestFixture";
            TestSuite suite = builder.Build(package);

            Assert.IsNotNull(suite);
            Assert.AreEqual(MockTestFixture.Tests, suite.TestCount);
        }
コード例 #33
0
        public void Setup()
        {
            statusBar = new StatusBar();

            TestSuiteBuilder builder = new TestSuiteBuilder();

            suite = builder.Build(new TestPackage(testsDll));

            mockEvents = new MockTestEventSource(suite);
        }
コード例 #34
0
        public void Setup()
        {
            progressBar = new TestProgressBar();

            TestSuiteBuilder builder = new TestSuiteBuilder();

            suite = new TestNode(builder.Build(new TestPackage(testsDll)));

            mockEvents = new MockTestEventSource(suite);
        }
コード例 #35
0
        private TestResult runTests(string nameSpace, TestFilter filter)
        {
            TestSuiteBuilder builder = new TestSuiteBuilder();
            TestPackage      package = new TestPackage(testAssembly);

            package.TestName = nameSpace;
            Test suite = builder.Build(package);

            return(suite.Run(new NullListener(), filter));
        }
コード例 #36
0
        public void LoadTestFixtureFromAssembly()
        {
            TestSuiteBuilder builder = new TestSuiteBuilder();
            TestPackage      package = new TestPackage(thisDll);

            package.TestName = this.GetType().FullName;
            Test suite = builder.Build(package);

            Assert.IsNotNull(suite, "Should not be Null");
        }
コード例 #37
0
        public void LoadTestFixtureFromAssembly()
        {
            TestSuiteBuilder builder = new TestSuiteBuilder();
            TestPackage      package = new TestPackage(testsDll);

            package.TestName = "NUnit.Tests.Assemblies.MockTestFixture";
            Test suite = builder.Build(package);

            Assert.IsNotNull(suite);
        }
コード例 #38
0
        public void Setup()
        {
            progressBar = new ProgressBar();

            TestSuiteBuilder builder = new TestSuiteBuilder();

            suite = builder.Build(testsDll);

            mockEvents = new MockTestEventSource(testsDll, suite);
        }
コード例 #39
0
        public void CanAddTestCategories()
        {
            TestSuiteBuilder builder = new TestSuiteBuilder();
            Test             suite   = builder.Build(new TestPackage("mock-assembly.dll"));

            Test test = TestFinder.Find("MockTest3", suite);

            categoryManager.AddCategories(test);
            Assert.AreEqual(2, categoryManager.Categories.Count);
        }
コード例 #40
0
ファイル: MainForm.cs プロジェクト: Waltervondehans/NBi
        private void buildTestSuiteToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var tsCreate = new TestSuiteCreate();
            tsCreate.Actual.QueriesDirectory = Configuration.Project.Directories[Configuration.DirectoryCollection.DirectoryType.Query].FullFileName;
            tsCreate.Actual.ConnectionString = Configuration.Project.ConnectionStrings[
                Configuration.ConnectionStringCollection.ConnectionClass.Oledb,
                Configuration.ConnectionStringCollection.ConnectionType.Expect
                ].Value;
            tsCreate.Expect.ResultSetsDirectory = Configuration.Project.Directories[Configuration.DirectoryCollection.DirectoryType.Expect].FullFileName;

            DialogResult dialogResult = tsCreate.ShowDialog();
            if (dialogResult.HasFlag(DialogResult.OK))
            {
                StartClick(null);
                try
                {
                    var tsb = new TestSuiteBuilder();
                    TestSuiteXml ts = null;

                    tsb.DefineActual(tsCreate.Actual.QueriesDirectory, tsCreate.Actual.ConnectionString);
                    if (tsCreate.Expect.IsResultSetsBased)
                        tsb.DefineExpect(tsCreate.Expect.ResultSetsDirectory);
                    else
                        tsb.DefineExpect(tsCreate.Expect.QueriesDirectory, tsCreate.Expect.ConnectionString);

                    ts = tsb.Build();

                    var xm = new XmlManager();

                    using (var sfd = new SaveFileDialog())
                    {
                        sfd.InitialDirectory = Configuration.Project.Directories[Configuration.DirectoryCollection.DirectoryType.TestSuite].FullPath;
                        sfd.FileName = Configuration.Project.Directories[Configuration.DirectoryCollection.DirectoryType.TestSuite].FilenameWithoutExtension;
                        sfd.Filter = "Xml|*.xml";
                        if (sfd.ShowDialog() == DialogResult.OK)
                        {
                            Configuration.Project.Directories[Configuration.DirectoryCollection.DirectoryType.TestSuite].FullFileName = sfd.FileName;
                            xm.Persist(sfd.FileName, ts);
                        }
                    }
                }
                finally
                {
                    Configuration.Project.Directories[Configuration.DirectoryCollection.DirectoryType.Query].FullFileName = tsCreate.Actual.QueriesDirectory;
                    Configuration.Project.ConnectionStrings[
                        Configuration.ConnectionStringCollection.ConnectionClass.Oledb,
                        Configuration.ConnectionStringCollection.ConnectionType.Actual
                        ].Value = tsCreate.Actual.ConnectionString;

                    if (tsCreate.Expect.IsResultSetsBased)
                        Configuration.Project.Directories[Configuration.DirectoryCollection.DirectoryType.Expect].FullFileName = tsCreate.Expect.ResultSetsDirectory;
                    EndClick(null);
                }
            }
        }
コード例 #41
0
        public void Setup()
        {
            ActionAttributeFixture.Results = new List<string>();

            TestSuiteBuilder builder = new TestSuiteBuilder();
            TestPackage package = new TestPackage(AssemblyHelper.GetAssemblyPath(typeof(ActionAttributeFixture)));
            package.TestName = typeof(ActionAttributeFixture).Namespace;

            Test suite = builder.Build(package);
            _result = suite.Run(new NullListener(), new ActionAttributeFixtureFilter());
        }
コード例 #42
0
        public void AssemblySetUpFixtureReplacesAssemblyNodeInTree()
        {
            TestSuiteBuilder builder = new TestSuiteBuilder();
            Test suite = builder.Build( new TestPackage( testAssembly ) );

            Assert.IsNotNull(suite);
            Assert.IsInstanceOf(typeof(SetUpFixture), suite);

            suite = suite.Tests[1] as TestSuite;
            Assert.AreEqual("SomeTestFixture", suite.TestName.Name);
            Assert.AreEqual(1, suite.TestCount);
        }
コード例 #43
0
		public void CheckEventListening()
		{
			TestSuiteBuilder builder = new TestSuiteBuilder();
			Test testSuite = builder.Build( new TestPackage( testsDll ) );
			
			EventCounter counter = new EventCounter();
            testSuite.Run(counter, TestFilter.Empty);
			Assert.AreEqual(testSuite.CountTestCases(TestFilter.Empty), counter.testCaseStart);
			Assert.AreEqual(testSuite.CountTestCases(TestFilter.Empty), counter.testCaseFinished);

			Assert.AreEqual(MockAssembly.SuitesRun, counter.suiteStarted);
			Assert.AreEqual(MockAssembly.SuitesRun, counter.suiteFinished);
		}
コード例 #44
0
ファイル: XmlTest.cs プロジェクト: fotisp/conqat
        private void runSchemaValidatorTest(TextWriter writer, CultureInfo testCulture)
        {
            // Preserve current culture
            CultureInfo previousCulture = Thread.CurrentThread.CurrentCulture;

            // Enable test culture
            Thread.CurrentThread.CurrentCulture = testCulture;

            try
            {
                string testsDll = "mock-assembly.dll";
                TestSuiteBuilder builder = new TestSuiteBuilder();
                Test suite = builder.Build( new TestPackage( testsDll ) );

                TestResult result = suite.Run(NullListener.NULL);

              XmlResultVisitor visitor = new XmlResultVisitor(writer, result);
                result.Accept(visitor);
                visitor.Write();

            }
            finally
            {
                // Restore previous culture
                Thread.CurrentThread.CurrentCulture = previousCulture;
            }
        }
コード例 #45
0
ファイル: XmlTest.cs プロジェクト: taoxiease/asegrp
        private void runSchemaValidatorTest(TextWriter writer)
        {
            string testsDll = "mock-assembly.dll";
            TestSuiteBuilder builder = new TestSuiteBuilder();
            Test suite = builder.Build( new TestPackage( testsDll ) );

            TestResult result = suite.Run(NullListener.NULL);

            XmlResultVisitor visitor = new XmlResultVisitor(writer, result);
            result.Accept(visitor);
            visitor.Write();
        }
コード例 #46
0
ファイル: XmlTest.cs プロジェクト: fotisp/conqat
        private void runSchemaValidatorTest(string reportFileName, CultureInfo testCulture)
        {
            // Preserve current culture
            CultureInfo previousCulture = Thread.CurrentThread.CurrentCulture;

            // Enable test culture
            Thread.CurrentThread.CurrentCulture = testCulture;

            try
            {
                string testsDll = "mock-assembly.dll";
                TestSuiteBuilder builder = new TestSuiteBuilder();
                Test suite = builder.Build( new TestPackage( testsDll ) );

                TestResult result = suite.Run(NullListener.NULL);

              XmlResultVisitor visitor = new XmlResultVisitor(reportFileName, result);
                result.Accept(visitor);
                visitor.Write();

                SchemaValidator validator = new SchemaValidator(reportFileName, schemaFile.Path);
                Assert.IsTrue(validator.Validate(), "validate failed");
            }
            finally
            {
                // Restore previous culture
                Thread.CurrentThread.CurrentCulture = previousCulture;
            }
        }
コード例 #47
0
ファイル: AssemblyTests.cs プロジェクト: scottwis/eddie
 public void LoadAssemblyNotFound()
 {
     TestSuiteBuilder builder = new TestSuiteBuilder();
     builder.Build( new TestPackage( "/XXXX.dll" ) );
 }
コード例 #48
0
ファイル: XmlTest.cs プロジェクト: taoxiease/asegrp
        private void runSchemaValidatorTest(string reportFileName)
        {
            string testsDll = "mock-assembly.dll";
            TestSuiteBuilder builder = new TestSuiteBuilder();
            Test suite = builder.Build( new TestPackage( testsDll ) );

            TestResult result = suite.Run(NullListener.NULL);

            XmlResultVisitor visitor = new XmlResultVisitor(reportFileName, result);
            result.Accept(visitor);
            visitor.Write();

            SchemaValidator validator = new SchemaValidator(reportFileName, schemaFile.Path);
            Assert.IsTrue(validator.Validate(), "validate failed");
        }
コード例 #49
0
ファイル: XmlTest.cs プロジェクト: torkelo/shouldly
        private void runSchemaValidatorTest(string reportFileName)
        {
            string testsDll = "mock-assembly.dll";
            TestSuiteBuilder builder = new TestSuiteBuilder();
            Test suite = builder.Build( new TestPackage( testsDll ) );

            TestResult result = suite.Run(NullListener.NULL, TestFilter.Empty);

            new XmlResultWriter(reportFileName).SaveTestResult(result);

            SchemaValidator validator = new SchemaValidator(reportFileName, schemaFile.Path);
            Assert.IsTrue(validator.Validate(), "validate failed");
        }
コード例 #50
0
ファイル: XmlTest.cs プロジェクト: torkelo/shouldly
        private void runSchemaValidatorTest(TextWriter writer)
        {
            string testsDll = "mock-assembly.dll";
            TestSuiteBuilder builder = new TestSuiteBuilder();
            Test suite = builder.Build( new TestPackage( testsDll ) );

            TestResult result = suite.Run(NullListener.NULL, TestFilter.Empty);

            new XmlResultWriter(writer).SaveTestResult(result);
        }