Ejemplo n.º 1
0
        public void TestCleanUp()
        {
            Logger.Info($"Cleaning up {TestContext.TestName}");
            if (_isEtpTest)
            {
                _server?.Stop();
                EtpCleanUp();
            }

            OnTestCleanUp();

            DevKit?.Container.Dispose();
            DevKit = null;

            DevKitAspect.RestoreDefaultSettings();
            WitsmlOperationContext.Current = null;

            Logger.Info($"Cleanup is complete for {TestContext.TestName}");
            log4net.ThreadContext.Properties["TestName"] = null;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Configures the specified dev kit.
        /// </summary>
        /// <param name="devKit">The dev kit.</param>
        /// <param name="context">The test context.</param>
        public void Configure(DevKitAspect devKit, TestContext context)
        {
            // Configure DependencyResolver
            GlobalConfiguration.Configuration.DependencyResolver = new DependencyResolver(devKit.Container);

            if (context == null)
            {
                return;
            }

            if (context.Properties.Contains("WitsmlStoreUrl"))
            {
                devKit.ConnectionUrl = context.Properties["WitsmlStoreUrl"].ToString();
            }

            if (context.Properties.Contains("MongoDbConnection"))
            {
                var connection = context.Properties["MongoDbConnection"].ToString();
                var provider   = new DatabaseProvider(devKit.Container, new MongoDbClassMapper(), connection);
                devKit.Container.Register <IDatabaseProvider>(provider);
            }
        }