/// <summary>
        /// Triggers the AfterTestGroup method to dispose or clean up any resources
        /// that were held for the length of the test group.
        /// </summary>
        public void Dispose()
        {
            GlobalConfiguration globalConfig =
                (GlobalConfiguration)ConfigurationManager.GetSection(SectionXPath);

            if (globalConfig.DeployDatabasesEachClass)
            {
                DbController.AfterTestGroup(_type, LogAction);
            }
        }
Example #2
0
        /// <summary>
        /// Triggers the AfterTestGroup method to dispose or clean up any resources
        /// that were held for the length of the collection test run.
        /// </summary>
        public void Dispose()
        {
            GlobalConfiguration globalConfig =
                (GlobalConfiguration)ConfigurationManager.GetSection(SectionXPath);

            // If not each class, then each collection.
            if (!globalConfig.DeployDatabasesEachClass)
            {
                // Log calls must unfortunately be discarded with xUnit as the following exception occurs:
                //
                // [Test Collection Cleanup Failure(DataAccess)]:
                // System.InvalidOperationException :
                // There is no currently active test case.
                DbController.AfterTestGroup(_type, msg => { });
            }
        }