Skip to content

bmcdavid/DotNetStarter.IntegrationTestTools

Repository files navigation

DotNetStarter.IntegrationTestTools

Build Status

This tool provides LocalDb database setup for running integration tests with tools such as Entity Framework.

To use this tool as part of continuous integration, the build agent must also support LocalDb, which can be provided by Visual Studio Team Services hosted build agents.

Usage Example without DotNetStarter

    // using Microsoft.VisualStudio.TestTools.UnitTesting;

    [TestClass]
    public class TestSetup
    {
        private static IDbIntegrationTestSetup DbIntegrationTestSetup;

        [AssemblyInitialize]
        public static void TestInit(TestContext testContext)
        {
            DbIntegrationTestSetup = new LocalDbIntegrationTestSetup()
                .SetDatabaseName("IntegrationTestTools_IntegrationTest")
                .Startup(() => 
                {
                    // note can run migrations here
                });
        }

        [AssemblyCleanup]
        public static void TestCleanup()
        {
            DbIntegrationTestSetup.Shutdown();
        }
    }

About

Integration test tools such as LocalDb database creation for integration testing

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published