mardi 16 juin 2015

Share Owin Test server among other test classes

How would you share the server instance among the other integration test methods?

 [TestClass()]
    public class InitializeTestServer
    {
        private static TestServer server;        

        [AssemblyInitialize]
        public static void Initialize(TestContext context)
        {
            server = TestServer.Create<Startup>(); 
        }

        [AssemblyCleanup]
        public static void CleanUp()
        {
            server.Dispose();
        }
    }

Aucun commentaire:

Enregistrer un commentaire