当前位置: 首页>>代码示例>>C#>>正文


C# Testable_xunit.Execute方法代码示例

本文整理汇总了C#中Testable_xunit.Execute方法的典型用法代码示例。如果您正苦于以下问题:C# Testable_xunit.Execute方法的具体用法?C# Testable_xunit.Execute怎么用?C# Testable_xunit.Execute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Testable_xunit的用法示例。


在下文中一共展示了Testable_xunit.Execute方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: LogsWelcomeBanner

        public static void LogsWelcomeBanner()
        {
            var xunit = new Testable_xunit();

            xunit.Execute();

            xunit.BuildEngine.Received().LogMessageEvent(Arg.Is<BuildMessageEventArgs>(bmea => ValidateWelcomeBanner(bmea)));
        }
开发者ID:MichalisN,项目名称:xunit,代码行数:8,代码来源:xunitTests.cs

示例2: ReturnsFalseWhenExitCodeIsNonZero

        public static void ReturnsFalseWhenExitCodeIsNonZero()
        {
            var xunit = new Testable_xunit(exitCode: 1);

            var result = xunit.Execute();

            Assert.False(result);
        }
开发者ID:commonsensesoftware,项目名称:xunit,代码行数:8,代码来源:xunitTests.cs

示例3: ReturnsTrueWhenExitCodeIsZeroAndFailCountIsZero

        public static void ReturnsTrueWhenExitCodeIsZeroAndFailCountIsZero()
        {
            var xunit = new Testable_xunit(exitCode: 0);

            var result = xunit.Execute();

            Assert.True(result);
        }
开发者ID:commonsensesoftware,项目名称:xunit,代码行数:8,代码来源:xunitTests.cs

示例4: DoesNotChangeCurrentDirectoryWhenWorkingFolderIsNull

        public static void DoesNotChangeCurrentDirectoryWhenWorkingFolderIsNull()
        {
            var currentFolder = Directory.GetCurrentDirectory();
            var xunit = new Testable_xunit();

            xunit.Execute();

            Assert.Equal(currentFolder, Directory.GetCurrentDirectory());
        }
开发者ID:MichalisN,项目名称:xunit,代码行数:9,代码来源:xunitTests.cs

示例5: ChangesCurrentDirectoryWhenWorkingFolderIsNotNull

        public void ChangesCurrentDirectoryWhenWorkingFolderIsNotNull()
        {
            var tempFolder = Environment.GetEnvironmentVariable("TEMP");
            var xunit = new Testable_xunit { WorkingFolder = tempFolder };

            xunit.Execute();

            Assert.Equal(tempFolder, Directory.GetCurrentDirectory());
        }
开发者ID:PKRoma,项目名称:xunit-codeplex,代码行数:9,代码来源:xunitTests.cs

示例6: ChangesCurrentDirectoryWhenWorkingFolderIsNotNull

        public static void ChangesCurrentDirectoryWhenWorkingFolderIsNotNull()
        {
            var tempFolder = Environment.GetEnvironmentVariable("TEMP");
            tempFolder = Path.GetFullPath(tempFolder); // Ensure that the 8.3 path is not used
            var xunit = new Testable_xunit { WorkingFolder = tempFolder };

            xunit.Execute();

            Assert.Equal(tempFolder, Directory.GetCurrentDirectory());
        }
开发者ID:MichalisN,项目名称:xunit,代码行数:10,代码来源:xunitTests.cs

示例7: LogsWelcomeBanner

        public static void LogsWelcomeBanner()
        {
            var xunit = new Testable_xunit();

            xunit.Execute();

            var eventArgs = Assert.IsType<BuildMessageEventArgs>(xunit.BuildEngine.Captured(x => x.LogMessageEvent(null)).Args().Single());
            Assert.Equal(string.Format("xUnit.net MSBuild Runner ({0}-bit .NET {1})", IntPtr.Size * 8, Environment.Version), eventArgs.Message);
            Assert.Equal(MessageImportance.High, eventArgs.Importance);
        }
开发者ID:commonsensesoftware,项目名称:xunit,代码行数:10,代码来源:xunitTests.cs

示例8: CallsExecuteAssemblyOnceForEachAssembly

        public void CallsExecuteAssemblyOnceForEachAssembly()
        {
            var visitor = new XmlTestExecutionVisitor(null, null);
            visitor.Finished.Set();
            var assm1 = new TaskItem(@"C:\Full\Path\1");
            var assm2 = new TaskItem(@"C:\Full\Path\2", new Dictionary<string, string> { { "ConfigFile", @"C:\Config\File" } });
            var xunit = new Testable_xunit { CreateVisitor_Result = visitor };
            xunit.Assemblies = new ITaskItem[] { assm1, assm2 };

            xunit.Execute();

            Assert.Collection(xunit.ExecuteAssembly_Calls,
                call => Assert.Equal(@"C:\Full\Path\1, (null)", call),
                call => Assert.Equal(@"C:\Full\Path\2, C:\Config\File", call)
            );
        }
开发者ID:PKRoma,项目名称:xunit-codeplex,代码行数:16,代码来源:xunitTests.cs

示例9: ChangesCurrentDirectoryWhenWorkingFolderIsNotNull

        public static void ChangesCurrentDirectoryWhenWorkingFolderIsNotNull()
        {
            var tempFolder = Environment.GetEnvironmentVariable("TEMP");
            tempFolder = Path.GetFullPath(tempFolder); // Ensure that the 8.3 path is not used
            var xunit = new Testable_xunit { WorkingFolder = tempFolder };

            xunit.Execute();

            string actual = Directory.GetCurrentDirectory();
            string expected = tempFolder;

            if (actual[actual.Length - 1] != Path.DirectorySeparatorChar)
            {
                actual += Path.DirectorySeparatorChar;
            }
            if (expected[expected.Length - 1] != Path.DirectorySeparatorChar)
            {
                expected += Path.DirectorySeparatorChar;
            }

            Assert.Equal(expected, actual);
        }
开发者ID:commonsensesoftware,项目名称:xunit,代码行数:22,代码来源:xunitTests.cs

示例10: WritesHtmlToDisk

        public static void WritesHtmlToDisk()
        {
            var tempFile = Path.GetTempFileName();
            File.Delete(tempFile);

            try
            {
                var visitor = new XmlTestExecutionVisitor(null, null) { Failed = 1 };
                visitor.Finished.Set();
                var task = Substitute.For<ITaskItem>();
                task.GetMetadata("FullPath").Returns("C:\\Full\\Path\\Name.dll");
                var htmlTaskItem = Substitute.For<ITaskItem>();
                htmlTaskItem.GetMetadata("FullPath").Returns(tempFile);
                var xunit = new Testable_xunit { CreateVisitor_Result = visitor, Assemblies = new[] { task }, Html = htmlTaskItem };

                xunit.Execute();

                Assert.True(File.Exists(tempFile));
            }
            finally
            {
                File.Delete(tempFile);
            }
        }
开发者ID:MichalisN,项目名称:xunit,代码行数:24,代码来源:xunitTests.cs

示例11: WritesXmlV1ToDisk

        public static void WritesXmlV1ToDisk()
        {
            var tempFile = Path.GetTempFileName();

            try
            {
                var visitor = new XmlTestExecutionVisitor(null, null) { Failed = 1 };
                visitor.Finished.Set();
                var task = Substitute.For<ITaskItem>();
                task.GetMetadata("FullPath").Returns("C:\\Full\\Path\\Name.dll");
                var xmlTaskItem = Substitute.For<ITaskItem>();
                xmlTaskItem.GetMetadata("FullPath").Returns(tempFile);
                var xunit = new Testable_xunit { CreateVisitor_Result = visitor, Assemblies = new[] { task }, XmlV1 = xmlTaskItem };

                xunit.Execute();

                new XmlDocument().Load(tempFile);  // File should exist as legal XML
            }
            finally
            {
                File.Delete(tempFile);
            }
        }
开发者ID:MichalisN,项目名称:xunit,代码行数:23,代码来源:xunitTests.cs

示例12: ReturnsFalseWhenFailCountIsNonZero

        public static void ReturnsFalseWhenFailCountIsNonZero()
        {
            var visitor = new XmlTestExecutionVisitor(null, null) { Failed = 1 };
            visitor.Finished.Set();
            var task = Substitute.For<ITaskItem>();
            task.GetMetadata("FullPath").Returns("C:\\Full\\Path\\Name.dll");
            var xunit = new Testable_xunit { CreateVisitor_Result = visitor, Assemblies = new[] { task } };
            xunit.DiscoveryTestCases.Add(Mocks.TestCase());

            var result = xunit.Execute();

            Assert.False(result);
        }
开发者ID:MichalisN,项目名称:xunit,代码行数:13,代码来源:xunitTests.cs

示例13: WritesXmlToDisk

        public void WritesXmlToDisk()
        {
            var tempFile = Path.GetTempFileName();

            try
            {
                var visitor = new MSBuildVisitor(null, null, null) { Failed = 1 };
                visitor.Finished.Set();
                var task = Substitute.For<ITaskItem>();
                task.GetMetadata("FullPath").Returns("C:\\Full\\Path\\Name.dll");
                var xmlTaskItem = Substitute.For<ITaskItem>();
                xmlTaskItem.GetMetadata("FullPath").Returns(tempFile);
                var xunit = new Testable_xunit { CreateVisitor_Result = visitor, Assemblies = new[] { task }, Xml = xmlTaskItem };

                xunit.Execute();

                Assert.DoesNotThrow(() => new XmlDocument().Load(tempFile));
            }
            finally
            {
                File.Delete(tempFile);
            }
        }
开发者ID:JoB70,项目名称:xunit,代码行数:23,代码来源:xunitTests.cs

示例14: StopsExecutingAssemblyWhenCanceled

        public void StopsExecutingAssemblyWhenCanceled()
        {
            var assembly = new TaskItem(@"C:\Full\Path\1");
            var xunit = new Testable_xunit { Assemblies = new ITaskItem[] { assembly } };
            xunit.Cancel();

            xunit.Execute();

            Assert.Empty(xunit.ExecuteAssembly_Calls);
        }
开发者ID:johnkg,项目名称:xunit,代码行数:10,代码来源:xunitTests.cs


注:本文中的Testable_xunit.Execute方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。