Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 5
0
        /// <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);
        }
Ejemplo n.º 6
0
        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);
 }
Ejemplo n.º 8
0
        public void SetUp()
        {
            var log = this.CreateLogger();

            SafelyTry.Action(() => ThrowsException(), log);
        }