Here are the examples of the csharp api Beef.Test.NUnit.TestSetUp.ShouldContinueRunningTestsAssert() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
1 Examples
19
Source : TestSetUp.cs
with MIT License
from Avanade
with MIT License
from Avanade
internal static void InvokeRegisteredSetUp()
{
lock (_lock)
{
ShouldContinueRunningTestsreplacedert();
if (_bypreplacedSetup)
return;
if (!_registeredSetupInvoked && (_registeredSetup != null || _registeredSetupAsync != null))
{
try
{
TestContext.Out.WriteLine();
TestContext.Out.WriteLine("Invocation of registered set up action.");
TestContext.Out.WriteLine(new string('=', 80));
if (_registeredSetup != null)
ShouldContinueRunningTests = _registeredSetup.Invoke(_registeredSetupCount++, _registeredSetupData);
if (_registeredSetupAsync != null)
ShouldContinueRunningTests = Task.Run(() => _registeredSetupAsync.Invoke(_registeredSetupCount++, _registeredSetupData)).GetAwaiter().GetResult();
if (!ShouldContinueRunningTests)
replacedert.Fail("This RegisterSetUp function failed to execute successfully.");
}
catch (replacedertionException) { throw; }
catch (Exception ex)
{
ShouldContinueRunningTests = false;
TestContext.Out.WriteLine($"This RegisterSetUp function failed to execute successfully: {ex.Message}{Environment.NewLine}{ex}");
replacedert.Fail($"This RegisterSetUp function failed to execute successfully: {ex.Message}");
}
finally
{
_registeredSetupInvoked = true;
TestContext.Out.WriteLine();
TestContext.Out.WriteLine(new string('=', 80));
TestContext.Out.WriteLine();
}
}
}
}