本文整理汇总了C#中Testable_xunit._ExecuteAssembly方法的典型用法代码示例。如果您正苦于以下问题:C# Testable_xunit._ExecuteAssembly方法的具体用法?C# Testable_xunit._ExecuteAssembly怎么用?C# Testable_xunit._ExecuteAssembly使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Testable_xunit
的用法示例。
在下文中一共展示了Testable_xunit._ExecuteAssembly方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RunsDiscoveredTests
public static void RunsDiscoveredTests()
{
var xunit = new Testable_xunit();
xunit.DiscoveryTestCases.Add(Substitute.For<ITestCase>());
var runTestCases = new List<ITestCase>();
xunit.FrontController.WhenAny(fc => fc.RunTests((IEnumerable<ITestCase>)null, null, null))
.Do(callInfo =>
{
runTestCases.AddRange((IEnumerable<ITestCase>)callInfo[0]);
});
xunit._ExecuteAssembly("assemblyFilename", "configFilename");
Assert.Equal(xunit.DiscoveryTestCases, runTestCases);
}
示例2: DoesNotRunFilteredTests
public static void DoesNotRunFilteredTests()
{
var xunit = new Testable_xunit { ExcludeTraits = "One=1" };
var testCase1 = Substitute.For<ITestCase>();
testCase1.Traits.Returns(new Dictionary<string, List<string>>());
xunit.DiscoveryTestCases.Add(testCase1);
var testCase2 = Substitute.For<ITestCase>();
testCase2.Traits.Returns(new Dictionary<string, List<string>> { { "One", new List<string> { "1" } } });
xunit.DiscoveryTestCases.Add(testCase2);
var runTestCases = new List<ITestCase>();
xunit.FrontController.WhenAny(fc => fc.RunTests((IEnumerable<ITestCase>)null, null, null))
.Do(callInfo =>
{
runTestCases.AddRange((IEnumerable<ITestCase>)callInfo[0]);
});
xunit._ExecuteAssembly("assembyFileName", "configFilename");
Assert.Equal(1, runTestCases.Count);
Assert.Contains(testCase1, runTestCases);
Assert.DoesNotContain(testCase2, runTestCases);
}
示例3: 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>());
}
示例4: DisposesOfFrontController
public static void DisposesOfFrontController()
{
var xunit = new Testable_xunit();
xunit._ExecuteAssembly("assemblyFilename", "configFilename");
xunit.FrontController.Received().Dispose();
}
示例5: RunsDiscoveredTests
public void RunsDiscoveredTests()
{
var xunit = new Testable_xunit();
var runTestCases = new List<ITestCase>();
xunit.FrontController.WhenAny(fc => fc.Run(null, null))
.Do(callInfo =>
{
runTestCases.AddRange((IEnumerable<ITestCase>)callInfo[0]);
((IMessageSink)callInfo[1]).OnMessage(new TestAssemblyFinished());
});
xunit._ExecuteAssembly("assemblyFilename", "configFilename");
Assert.Equal(xunit.DiscoveryTestCases, runTestCases);
}
示例6: LogsAssemblyMessage
public void LogsAssemblyMessage()
{
var xunit = new Testable_xunit();
xunit._ExecuteAssembly("assemblyFilename", "configFilename");
xunit.BuildEngine.Received().LogMessageEvent(Arg.Is<BuildMessageEventArgs>(bmea => ValidateAssemblyBanner(bmea)));
}
示例7: ErrorsDuringExecutionAreLogged
public void ErrorsDuringExecutionAreLogged()
{
var exception = new DivideByZeroException();
var xunit = new Testable_xunit { CreateFrontController_Exception = exception };
var messages = new List<string>();
xunit._ExecuteAssembly("assemblyFilename", "configFilename");
xunit.BuildEngine.Received().LogErrorEvent(Arg.Is<BuildErrorEventArgs>(beea => CaptureErrorMessage(beea, messages)));
Assert.Equal("System.DivideByZeroException: Attempted to divide by zero.", messages[0]);
}