Пример #1
0
 private static void CreateNewContainerAndDbContext()
 {
     if (TestDependencyScope.IsInitialized())
     {
         TestDependencyScope.End();
         TestDependencyScope.Begin();
     }
 }
Пример #2
0
        public void Execute(TestClass testClass)
        {
            TestingIoC.Initialize();
            TestDependencyScope.Begin();

            ResetDatabase();

            var fixture = new Fixture();

            AutoFixtureParameterSource.CustomizeAutoFixture(fixture);
            var instance = new SpecimenContext(fixture).Resolve(testClass.Type);

            testClass.RunCases(@case => { @case.Execute(instance); });

            TestDependencyScope.End();

            instance.Dispose();
        }