本文整理汇总了C#中Testable_xunit类的典型用法代码示例。如果您正苦于以下问题:C# Testable_xunit类的具体用法?C# Testable_xunit怎么用?C# Testable_xunit使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Testable_xunit类属于命名空间,在下文中一共展示了Testable_xunit类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: 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
示例2: 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
示例3: VisitorIsTeamCityVisitorWhenTeamCityIsTrue
public static void VisitorIsTeamCityVisitorWhenTeamCityIsTrue()
{
var xunit = new Testable_xunit { TeamCity = true };
var visitor = xunit._CreateVisitor("filename");
Assert.IsType<TeamCityVisitor>(visitor);
}
开发者ID:MichalisN,项目名称:xunit,代码行数:8,代码来源:xunitTests.cs
示例4: 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
示例5: DefaultVisitorIsStandardOutputVisitor
public static void DefaultVisitorIsStandardOutputVisitor()
{
var xunit = new Testable_xunit { TeamCity = false };
var visitor = xunit._CreateVisitor("filename");
Assert.IsType<StandardOutputVisitor>(visitor);
}
开发者ID:MichalisN,项目名称:xunit,代码行数:8,代码来源:xunitTests.cs
示例6: 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
示例7: 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
示例8: 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
示例9: 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
示例10: 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
示例11: 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
示例12: DiscoversAllTestsInAssembly
public static void DiscoversAllTestsInAssembly()
{
var xunit = new Testable_xunit();
xunit._ExecuteAssembly("assemblyFilename", "configFilename");
xunit.FrontController.Received().Find(false, Arg.Any<IMessageSink>(), Arg.Any<ITestFrameworkDiscoveryOptions>());
}
开发者ID:MichalisN,项目名称:xunit,代码行数:8,代码来源:xunitTests.cs
示例13: DisposesOfFrontController
public static void DisposesOfFrontController()
{
var xunit = new Testable_xunit();
xunit._ExecuteAssembly("assemblyFilename", "configFilename");
xunit.FrontController.Received().Dispose();
}
开发者ID:MichalisN,项目名称:xunit,代码行数:8,代码来源:xunitTests.cs
示例14: 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
示例15: NoExplicitReporter_NoEnvironmentallyEnabledReporters_UsesDefaultReporter
public void NoExplicitReporter_NoEnvironmentallyEnabledReporters_UsesDefaultReporter()
{
var implicitReporter = Mocks.RunnerReporter(isEnvironmentallyEnabled: false);
var xunit = new Testable_xunit();
xunit.AvailableReporters.Add(implicitReporter);
var reporter = xunit.GetReporter();
Assert.IsType<DefaultRunnerReporterWithTypes>(reporter);
}
开发者ID:commonsensesoftware,项目名称:xunit,代码行数:10,代码来源:xunitTests.cs
示例16: 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
示例17: 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
示例18: NoExplicitReporter_SelectsFirstEnvironmentallyEnabledReporter
public void NoExplicitReporter_SelectsFirstEnvironmentallyEnabledReporter()
{
var explicitReporter = Mocks.RunnerReporter("switch");
var implicitReporter1 = Mocks.RunnerReporter(isEnvironmentallyEnabled: true);
var implicitReporter2 = Mocks.RunnerReporter(isEnvironmentallyEnabled: true);
var xunit = new Testable_xunit();
xunit.AvailableReporters.AddRange(new[] { explicitReporter, implicitReporter1, implicitReporter2 });
var reporter = xunit.GetReporter();
Assert.Same(implicitReporter1, reporter);
}
开发者ID:commonsensesoftware,项目名称:xunit,代码行数:12,代码来源:xunitTests.cs
示例19: NoReporters_UsesDefaultReporter
public void NoReporters_UsesDefaultReporter()
{
var xunit = new Testable_xunit();
var reporter = xunit.GetReporter();
Assert.IsType<DefaultRunnerReporterWithTypes>(reporter);
}
开发者ID:commonsensesoftware,项目名称:xunit,代码行数:8,代码来源:xunitTests.cs
示例20: ExplicitReporter_WithEnvironmentalOverride_UsesEnvironmentalOverride
public void ExplicitReporter_WithEnvironmentalOverride_UsesEnvironmentalOverride()
{
var explicitReporter = Mocks.RunnerReporter("switch");
var implicitReporter = Mocks.RunnerReporter(isEnvironmentallyEnabled: true);
var xunit = new Testable_xunit { Reporter = "switch" };
xunit.AvailableReporters.AddRange(new[] { explicitReporter, implicitReporter });
var reporter = xunit.GetReporter();
Assert.Same(implicitReporter, reporter);
}
开发者ID:commonsensesoftware,项目名称:xunit,代码行数:11,代码来源:xunitTests.cs
注:本文中的Testable_xunit类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论