public void SetUp() { var log = this.CreateLogger(); wasCalled = false; SafelyTry.Action(() => WasCalled(), log); }
public void SetUp() { var log = this.CreateLogger(); disposable = Substitute.For <IDisposable>(); SafelyTry.Dispose(disposable, log); }
public void SetUp() { var log = this.CreateLogger(); testObject = new TestObject(); SafelyTry.Action(testObject, x => x.Call(), log); }
public void SetUp() { var log = this.CreateLogger(); disposable = Substitute.For <IDisposable>(); disposable.When(x => x.Dispose()).Throw <Exception>(); SafelyTry.Dispose(disposable, log); }
/// <inheritdoc /> public void AfterTest(ITest testDetails) { var currentContext = TestContext.CurrentContext; if (currentContext.Result.Outcome.Status == TestStatus.Failed) { SafelyTry.Action(() => SaveScreenshotForEachTab(currentContext, "_post")); } SafelyTry.Action(() => webDriver.Close()); SafelyTry.Action(() => webDriver.Quit()); SafelyTry.Dispose(webDriver); }
public void AfterTest(ITest test) { var fixture = GetRequireSessionFactoryFromFixture(test); fixture.OpenSession = fixture.SessionFactoryManager.SessionProvider; if (fixture is ISetupData data) { log.LogInformation("Invoking SetupData"); data.CleanupData(); } SafelyTry.Dispose(fixture.SessionFactoryManager); }
public void TearDown() { SafelyTry.Dispose(webDriver); SafelyTry.Dispose(webHost); }
public void SetUp() { var log = this.CreateLogger(); SafelyTry.Action(() => ThrowsException(), log); }